Method: Fix::Protocol::Field#parse

Defined in:
lib/fix/protocol/field.rb

#parse(str) ⇒ String

Parses the value for this field from the beginning of the string passed as parameter and return the rest of the string. The field value is assigned to the @value instance variable

Parameters:

  • str (String)

    A string starting with the field to parse

Returns:

  • (String)

    The same string with the field stripped off



47
48
49
50
51
52
53
54
# File 'lib/fix/protocol/field.rb', line 47

def parse(str)
  if str.match(/^#{tag}\=([^\x01]+)\x01/)
    @value = $1
    str.gsub(/^[^\x01]+\x01/, '')
  else
    str
  end
end