Class: Mapricot::Attribute
- Inherits:
-
Object
- Object
- Mapricot::Attribute
- Defined in:
- lib/mapricot/attribute.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, type) ⇒ Attribute
constructor
A new instance of Attribute.
- #set_value_from_node(node) ⇒ Object
Constructor Details
#initialize(name, type) ⇒ Attribute
Returns a new instance of Attribute.
5 6 7 8 |
# File 'lib/mapricot/attribute.rb', line 5 def initialize(name, type) @name = name @type = type end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/mapricot/attribute.rb', line 3 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/mapricot/attribute.rb', line 3 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/mapricot/attribute.rb', line 3 def value @value end |
Instance Method Details
#set_value_from_node(node) ⇒ Object
10 11 12 13 |
# File 'lib/mapricot/attribute.rb', line 10 def set_value_from_node(node) @value = node.attributes[name.to_s] typecast end |