Module: Enumerable

Included in:
Buffer::Array, Native::Array, Set, SourceMap::Map
Defined in:
opal/stdlib/json.rb,
opal/stdlib/set.rb

Overview

BUG: Enumerable must come before Array, otherwise it overrides #to_json this is due to how modules are implemented.

Instance Method Summary collapse

Instance Method Details

#to_jsonObject



111
112
113
# File 'opal/stdlib/json.rb', line 111

def to_json
  to_a.to_json
end

#to_set(klass = Set, *args, &block) ⇒ Object



167
168
169
# File 'opal/stdlib/set.rb', line 167

def to_set(klass = Set, *args, &block)
  klass.new(self, *args, &block)
end