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


198
199
200
# File 'opal/stdlib/set.rb', line 198

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