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



206
207
208
# File 'opal/stdlib/native.rb', line 206

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

Instance Method Details

#initialize(native) ⇒ Object



193
194
195
196
197
198
199
# File 'opal/stdlib/native.rb', line 193

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



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

def to_n
  @native
end