Method: BinStruct::SInt16#initialize

Defined in:
lib/bin_struct/int.rb

#initialize(options = {}) ⇒ SInt16

Returns a new instance of SInt16.

Parameters:

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

Options Hash (options):

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


193
194
195
196
197
# File 'lib/bin_struct/int.rb', line 193

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