Class: Struct

Inherits:
Object show all
Defined in:
opal/stdlib/native.rb

Direct Known Subclasses

SourceMap::Mapping

Instance Method Summary collapse

Instance Method Details

#to_nObject

values as values.

Returns:

  • a JavaScript object with the members as keys and their


478
479
480
481
482
483
484
485
486
# File 'opal/stdlib/native.rb', line 478

def to_n
  result = `{}`

  each_pair {|name, value|
    `#{result}[#{name}] = #{Native.try_convert(value, value)}`
  }

  result
end