Class: XML::Smart::Dom::Attribute
- Inherits:
-
Object
- Object
- XML::Smart::Dom::Attribute
- Defined in:
- lib/xml/smart_domattribute.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #===(cls) ⇒ Object
-
#initialize(attr) ⇒ Attribute
constructor
A new instance of Attribute.
- #parent ⇒ Object
- #path ⇒ Object
- #qname ⇒ Object
- #to_f ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
- #unique_id ⇒ Object
- #value ⇒ Object (also: #text)
- #value=(val) ⇒ Object (also: #text=)
Constructor Details
#initialize(attr) ⇒ Attribute
Returns a new instance of Attribute.
6 7 8 |
# File 'lib/xml/smart_domattribute.rb', line 6 def initialize(attr) @node = attr end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 25 26 |
# File 'lib/xml/smart_domattribute.rb', line 22 def ==(other) return false unless other return false unless other.respond_to?(:unique_id) unique_id == other.unique_id end |
#===(cls) ⇒ Object
10 |
# File 'lib/xml/smart_domattribute.rb', line 10 def ===(cls); self.is_a? cls; end |
#parent ⇒ Object
29 |
# File 'lib/xml/smart_domattribute.rb', line 29 def parent; Dom::smart_helper(@node.parent); end |
#path ⇒ Object
17 |
# File 'lib/xml/smart_domattribute.rb', line 17 def path; @node.path; end |
#to_f ⇒ Object
14 |
# File 'lib/xml/smart_domattribute.rb', line 14 def to_f; @node.content.to_f; end |
#to_i ⇒ Object
13 |
# File 'lib/xml/smart_domattribute.rb', line 13 def to_i; @node.content.to_i; end |
#to_s ⇒ Object
12 |
# File 'lib/xml/smart_domattribute.rb', line 12 def to_s; @node.content; end |
#unique_id ⇒ Object
27 |
# File 'lib/xml/smart_domattribute.rb', line 27 def unique_id; @node.pointer_id; end |
#value ⇒ Object Also known as: text
19 |
# File 'lib/xml/smart_domattribute.rb', line 19 def value; @node.content; end |
#value=(val) ⇒ Object Also known as: text=
20 |
# File 'lib/xml/smart_domattribute.rb', line 20 def value=(val); @node.content = val; end |