Class: Eancom::Parser::Segment
- Inherits:
-
Object
- Object
- Eancom::Parser::Segment
- Defined in:
- lib/eancom/parser/segment.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
-
#string ⇒ Object
Returns the value of attribute string.
-
#tag ⇒ Object
writeonly
Sets the attribute tag.
Instance Method Summary collapse
-
#initialize(string) ⇒ Segment
constructor
A new instance of Segment.
- #parse ⇒ Object
Constructor Details
#initialize(string) ⇒ Segment
Returns a new instance of Segment.
7 8 9 10 |
# File 'lib/eancom/parser/segment.rb', line 7 def initialize(string) @string = string @components = [] end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
5 6 7 |
# File 'lib/eancom/parser/segment.rb', line 5 def components @components end |
#string ⇒ Object
Returns the value of attribute string.
5 6 7 |
# File 'lib/eancom/parser/segment.rb', line 5 def string @string end |
#tag=(value) ⇒ Object
Sets the attribute tag
5 6 7 |
# File 'lib/eancom/parser/segment.rb', line 5 def tag=(value) @tag = value end |
Instance Method Details
#parse ⇒ Object
12 13 14 15 16 17 |
# File 'lib/eancom/parser/segment.rb', line 12 def parse parse_component klass = find_segment_class structure = find_structure klass.initialize_by_components(structure, @components) end |