Class: Struct

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

Instance Method Summary collapse

Instance Method Details

#to_nObject

values as values.

Returns:

  • a JavaScript object with the members as keys and their



483
484
485
486
487
488
489
490
491
# File 'opal/stdlib/native.rb', line 483

def to_n
  result = `{}`

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

  result
end