Class: BinStruct::Int16le

Inherits:
Int16 show all
Defined in:
lib/bin_struct/int.rb

Overview

Little endian 2-byte unsigned integer

Author:

  • Sylvain Daubert (2016-2024)

  • LemonTree55

Instance Attribute Summary

Attributes inherited from Int

#default, #endian, #value, #width

Instance Method Summary collapse

Methods inherited from Int

#format_inspect, #from_human, #nbits, #read, #sz, #to_f, #to_i, #to_s

Methods included from Structable

#format_inspect, #read, #sz, #to_human, #to_s, #type_name

Constructor Details

#initialize(options = {}) ⇒ Int16le

Returns a new instance of Int16le.

Parameters:

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

Options Hash (options):

  • :value (Integer, nil)


165
166
167
168
# File 'lib/bin_struct/int.rb', line 165

def initialize(options = {})
  opts = { value: options[:value], endian: :little }
  super(opts)
end