Class: BinStruct::Int8Enum
Overview
Enumeration on one byte. See Enum.
Instance Attribute Summary
Attributes inherited from Enum
Attributes inherited from Int
#default, #endian, #value, #width
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Int8Enum
constructor
A new instance of Int8Enum.
Methods inherited from Enum
#format_inspect, #to_human, #value=
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 = {}) ⇒ Int8Enum
Returns a new instance of Int8Enum.
94 95 96 97 98 99 100 |
# File 'lib/bin_struct/enum.rb', line 94 def initialize( = {}) opts = .slice(:enum, :value, :default) opts[:width] = 1 opts[:endian] = nil super(opts) @packstr = { nil => 'C' } end |