Class: Ambling::Data::BaseValue
- Inherits:
-
Object
- Object
- Ambling::Data::BaseValue
- Defined in:
- lib/ambling/data.rb
Overview
A data point in the XML has a value and attributes
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #build_xml(builder) ⇒ Object
-
#initialize(value, attributes = {}) ⇒ BaseValue
constructor
A new instance of BaseValue.
- #tag_name ⇒ Object
- #to_xml(builder = nil) ⇒ Object
Constructor Details
#initialize(value, attributes = {}) ⇒ BaseValue
Returns a new instance of BaseValue.
25 26 27 28 |
# File 'lib/ambling/data.rb', line 25 def initialize(value, attributes={}) @value = value @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
23 24 25 |
# File 'lib/ambling/data.rb', line 23 def attributes @attributes end |
#value ⇒ Object
Returns the value of attribute value.
23 24 25 |
# File 'lib/ambling/data.rb', line 23 def value @value end |
Instance Method Details
#build_xml(builder) ⇒ Object
40 41 42 |
# File 'lib/ambling/data.rb', line 40 def build_xml(builder) builder.tag!(tag_name, @value, @attributes) end |
#tag_name ⇒ Object
36 37 38 |
# File 'lib/ambling/data.rb', line 36 def tag_name "value" end |
#to_xml(builder = nil) ⇒ Object
30 31 32 33 34 |
# File 'lib/ambling/data.rb', line 30 def to_xml(builder = nil) builder ||= Builder::XmlMarkup.new build_xml(builder) builder.target! end |