Class: Finance::FIX

Inherits:
Object
  • Object
show all
Defined in:
lib/finance-fix.rb

Overview

Finance::FIX - Parse FIX protocol messages

Constant Summary collapse

VERSION =
'0.0.1'

Instance Method Summary collapse

Instance Method Details

#new {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Finance::FIX)

    the object that the method was called on



6
7
8
# File 'lib/finance-fix.rb', line 6

def new
  yield self if block_given?
end

#parse(msg) ⇒ Object

Parse “message”, returning array of FIX message nodes, broken down in arrays of keys and values.



12
13
14
# File 'lib/finance-fix.rb', line 12

def parse(msg)
  msg.split(/\x01/).collect { |pair| pair.split(/=/) }  # Split on "SOH then "="
end