Class: JsshDOMNode
- Inherits:
-
JsshObject
- Object
- JsshObject
- JsshDOMNode
- 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, #instanceof, #invoke, #method_missing, #object_respond_to?, #object_type, #pass, #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_json, #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
#dump(options = {}) ⇒ Object
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 |
# File 'lib/vapir-firefox/jssh_socket.rb', line 1037 def dump(={}) ={:recurse => nil, :level => 0}.merge() =.merge(:recurse => [:recurse] && ([:recurse]-1), :level => [:level]+1) result=(" "*[:level]*2)+self.inspect+"\n" if [:recurse]==0 result+=(" "*[:level]*2)+"...\n" else self.childNodes.to_array.each do |child| result+=child.to_dom.dump() end end result end |
#inspect ⇒ Object
1021 1022 1023 |
# File 'lib/vapir-firefox/jssh_socket.rb', line 1021 def inspect "\#<#{self.class.name} #{inspect_stuff.map{|(k,v)| "#{k}=#{v.inspect}"}.join(', ')}>" end |
#inspect_stuff ⇒ Object
1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 |
# File 'lib/vapir-firefox/jssh_socket.rb', line 1011 def inspect_stuff [:nodeName, :nodeType, :nodeValue, :tagName, :textContent, :id, :name, :value, :type, :className, :hidden].map do |attrn| attr=attr(attrn) if ['undefined','null'].include?(attr.type) nil else [attrn, attr.val_or_object(:error_on_undefined => false)] end end.compact end |
#pretty_print(pp) ⇒ Object
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 |
# File 'lib/vapir-firefox/jssh_socket.rb', line 1024 def pretty_print(pp) pp.object_address_group(self) do pp.seplist(inspect_stuff, lambda { pp.text ',' }) do |attr_val| pp.breakable ' ' pp.group(0) do pp.text attr_val.first.to_s pp.text ': ' #pp.breakable pp.text attr_val.last.inspect end end end end |