Module: Native::Wrapper

Included in:
Buffer, Buffer::Array, Buffer::View, Console, Array, Object
Defined in:
opal/stdlib/native.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


203
204
205
# File 'opal/stdlib/native.rb', line 203

def self.included(klass)
  klass.extend Helpers
end

Instance Method Details

#initialize(native) ⇒ Object


190
191
192
193
194
195
196
# File 'opal/stdlib/native.rb', line 190

def initialize(native)
  unless ::Kernel.native?(native)
    ::Kernel.raise ArgumentError, "#{native.inspect} isn't native"
  end

  @native = native
end

#to_nObject

Returns the internal native JavaScript value


199
200
201
# File 'opal/stdlib/native.rb', line 199

def to_n
  @native
end