Class: LensProtocol::OMA::Type::R

Inherits:
Base
  • Object
show all
Defined in:
lib/lens_protocol/oma/type/r.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from LensProtocol::OMA::Type::Base

Instance Method Details

#format(_record, _message) ⇒ Object



12
13
14
# File 'lib/lens_protocol/oma/type/r.rb', line 12

def format _record, _message
  [] # Formatted in Type::Trcfmt
end

#parse(line, message) ⇒ Object



5
6
7
8
9
10
# File 'lib/lens_protocol/oma/type/r.rb', line 5

def parse line, message
  label, values = label_and_values line
  trcfmt = message.context(:last_trcfmt) or raise ParsingError.new('Could not found a corresponding TRCFMT record', line)
  values = Trcfmt.number(trcfmt) == 1 ? values.map(&:to_i) : values
  message.add_record_side_values(label, Trcfmt.side_pos(trcfmt), values)
end