Method: BinStruct::SInt32#initialize

Defined in:
lib/bin_struct/int.rb

#initialize(options = {}) ⇒ SInt32

Returns a new instance of SInt32.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :value (Integer)
  • :endian (:big, :little, :native)


368
369
370
371
372
# File 'lib/bin_struct/int.rb', line 368

def initialize(options = {})
  opts = { value: options[:value], endian: options[:endian] || :big }
  super(opts)
  @packstr = { big: 'l>', little: 'l<', native: 'l' }
end