Class: JsshArray

Inherits:
JsshObject show all
Includes:
Enumerable
Defined in:
lib/vapir-firefox/jssh_socket.rb

Instance Attribute Summary

Attributes inherited from JsshObject

#debug_name, #function_result, #jssh_socket, #ref, #type

Instance Method Summary collapse

Methods inherited from JsshObject

#%, #*, #+, #-, #/, #<, #<=, #==, #>, #>=, #[], #[]=, #assign, #assign_expr, #attr, #binary_operator, #call, #define_methods!, #id, #implemented_interfaces, #initialize, #inspect, #instanceof, #invoke, #method_missing, #object_respond_to?, #object_type, #pass, #pretty_print, #respond_to?, #store, #store_rand_named, #store_rand_object_key, #store_rand_prefix, #store_rand_temp, #sub, #to_array, #to_dom, #to_hash, #to_js_array, #to_js_hash, #to_js_hash_safe, #to_jssh, #to_ruby_hash, #val, #val_or_object, #val_str

Constructor Details

This class inherits a constructor from JsshObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class JsshObject

Instance Method Details

#eachObject

Raises:



1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
# File 'lib/vapir-firefox/jssh_socket.rb', line 1053

def each
  length=self.length
  raise JsshError, "length #{length.inspect} is not a non-negative integer on #{self.ref}" unless length.is_a?(Integer) && length >= 0
  for i in 0...length
    element=self[i]
    if element.is_a?(JsshObject)
      # yield a more permanent reference than the array subscript 
      element=element.store_rand_temp
    end
    yield element
  end
end

#to_json(options = {}) ⇒ Object

Enumerable clobbers this; redefine



1066
1067
1068
# File 'lib/vapir-firefox/jssh_socket.rb', line 1066

def to_json(options={}) # Enumerable clobbers this; redefine
  ref
end