Class: Struct

Inherits:
Object show all
Defined in:
/Users/elia/Code/opal-docs/opal/stdlib/native.rb

Direct Known Subclasses

SourceMap::Mapping

Instance Method Summary collapse

Instance Method Details

#to_nObject

Public: Returns a JavaScript object with the members as keys and their values as values.


475
476
477
478
479
480
481
482
483
# File '/Users/elia/Code/opal-docs/opal/stdlib/native.rb', line 475

def to_n
  result = `{}`

  each_pair {|name, value|
    `#{result}[#{name}] = #{value.to_n}`
  }

  result
end