Class: Gattica::Segment
- Inherits:
-
Object
- Object
- Gattica::Segment
- Includes:
- Convertible
- Defined in:
- lib/gattica/segment.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Segment
constructor
A new instance of Segment.
Methods included from Convertible
#to_h, #to_query, #to_s, #to_xml
Constructor Details
#initialize(xml) ⇒ Segment
Returns a new instance of Segment.
10 11 12 13 14 |
# File 'lib/gattica/segment.rb', line 10 def initialize(xml) @id = xml.attributes['id'] @name = xml.attributes['name'] @definition = xml.at("dxp:definition").inner_html end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
8 9 10 |
# File 'lib/gattica/segment.rb', line 8 def definition @definition end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/gattica/segment.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/gattica/segment.rb', line 8 def name @name end |