Class: Codec::Numbin

Inherits:
Base
  • Object
show all
Defined in:
lib/codec/fix.rb

Instance Attribute Summary

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Base

#add_subparser, #decode, #decode_with_length, #get_sub_parsers, #init_data, #initialize

Constructor Details

This class inherits a constructor from Codec::Base

Instance Method Details

#build_fieldObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/codec/fix.rb', line 3

def build_field
  f = Field.new(@id)
  res = 0
  @data.unpack("C*").each{ |ubyte|
    res *= 256
    res += ubyte
  }
  f.set_value(res)
  return f
end