Class: Itonoko::XML::Attr
- Inherits:
-
Object
- Object
- Itonoko::XML::Attr
- Defined in:
- lib/itonoko/xml/attr.rb
Constant Summary collapse
- ATTRIBUTE_NODE =
2
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value, document = nil) ⇒ Attr
constructor
A new instance of Attr.
- #inspect ⇒ Object
- #node_name ⇒ Object
- #node_type ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value, document = nil) ⇒ Attr
Returns a new instance of Attr.
10 11 12 13 14 |
# File 'lib/itonoko/xml/attr.rb', line 10 def initialize(name, value, document = nil) @name = name @value = value @document = document end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
6 7 8 |
# File 'lib/itonoko/xml/attr.rb', line 6 def document @document end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/itonoko/xml/attr.rb', line 6 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/itonoko/xml/attr.rb', line 6 def value @value end |
Instance Method Details
#inspect ⇒ Object
28 29 30 |
# File 'lib/itonoko/xml/attr.rb', line 28 def inspect "#<#{self.class} name=#{name.inspect} value=#{value.inspect}>" end |
#node_name ⇒ Object
16 17 18 |
# File 'lib/itonoko/xml/attr.rb', line 16 def node_name @name end |
#node_type ⇒ Object
20 21 22 |
# File 'lib/itonoko/xml/attr.rb', line 20 def node_type ATTRIBUTE_NODE end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/itonoko/xml/attr.rb', line 24 def to_s value.to_s end |