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



128
129
130
# File 'opal/stdlib/json.rb', line 128

def to_json
  to_a.to_json
end

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



200
201
202
# File 'opal/stdlib/set.rb', line 200

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