class Fix::Protocol::Messages::Instrument

An Instrument component, see www.onixs.biz/fix-dictionary/4.4/compBlock_Instrument.html

Constants

PRODUCTS

The product codes

SECURITY_ID_SOURCE

The security ID source codes

Public Instance Methods

can_parse?(str) click to toggle source

Checks whether the start of the given string can be parsed as this particular part

@param str [String] The string for which we want to parse the beginning @return [Boolean] Whether the beginning of the string can be parsed for this field

# File lib/fix/protocol/messages/instrument.rb, line 66
def can_parse?(str)
  str =~ /(#{self.class.structure.map { |i| i[:tag] }.map(&:to_s).join('|')})=[^\x01]+\x01/
end
errors() click to toggle source

Returns an error if security_id and security_source_id are not in the same filled/empty state

Calls superclass method
# File lib/fix/protocol/messages/instrument.rb, line 73
def errors
  e = []

  if !!security_id ^ !!security_id_source
    e << "Security ID, and security source must either be both blank, or both must be provided"
  end

  [super, e].flatten
end