Class: Sol::JSArray

Inherits:
JSObject show all
Defined in:
lib/jx/jsarray.rb

Overview

Instance Attribute Summary

Attributes inherited from JSObject

#jsvalue

Instance Method Summary collapse

Methods inherited from JSObject

#assign, #boolean?, #boolean_object?, build, #function?, #initialize, #instanceof, #method_missing, #nil?, #number?, #number_object?, #object?, #string?, #string_object?, #typeof, #undefined?

Constructor Details

This class inherits a constructor from Sol::JSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sol::JSObject

Instance Method Details

#[](index) ⇒ Object





52
53
54
# File 'lib/jx/jsarray.rb', line 52

def [](index)
  get(index)
end

#array?Boolean



Returns:

  • (Boolean)


36
37
38
# File 'lib/jx/jsarray.rb', line 36

def array?
  true
end

#get(index) ⇒ Object





44
45
46
# File 'lib/jx/jsarray.rb', line 44

def get(index)
  JSObject.build(@jsvalue.get(index), @jsvalue) # @jsvalue
end

#lengthObject





60
61
62
# File 'lib/jx/jsarray.rb', line 60

def length
  @jsvalue.length
end