Class: BinStruct::SInt8

Inherits:
Int
  • Object
show all
Defined in:
lib/bin_struct/int.rb

Overview

One byte signed integer

Author:

  • 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 = {}) ⇒ SInt8

Returns a new instance of SInt8.

Parameters:

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

Options Hash (options):

  • :value (Integer, nil)


129
130
131
132
133
134
# File 'lib/bin_struct/int.rb', line 129

def initialize(options = {})
  options[:endian] = nil
  options[:width] = 1
  super
  @packstr = { nil => 'c' }
end