Class: LensProtocol::OMA::Line
- Inherits:
-
Struct
- Object
- Struct
- LensProtocol::OMA::Line
- Defined in:
- lib/lens_protocol/oma/line.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#label ⇒ Object
Returns the value of attribute label.
-
#raw ⇒ Object
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
3 4 5 |
# File 'lib/lens_protocol/oma/line.rb', line 3 def data @data end |
#label ⇒ Object
Returns the value of attribute label
3 4 5 |
# File 'lib/lens_protocol/oma/line.rb', line 3 def label @label end |
#raw ⇒ Object
Returns the value of attribute raw
3 4 5 |
# File 'lib/lens_protocol/oma/line.rb', line 3 def raw @raw end |
Class Method Details
.parse(raw_line) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/lens_protocol/oma/line.rb', line 4 def self.parse raw_line raise ParsingError.new('The label separator is missing', raw_line) unless raw_line.include?('=') label, data = raw_line.split('=', -1) Line.new label: label, data: data, raw: raw_line end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/lens_protocol/oma/line.rb', line 11 def to_s "#{label}=#{data}" end |