Module: Enumerable

Included in:
Buffer::Array, Matrix, Native::Array, Set, Vector
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



234
235
236
# File 'opal/stdlib/set.rb', line 234

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