Class: Rstruct::PackedType
- Includes:
- Packable
- Defined in:
- lib/rstruct/base_types/packed_type.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#sizeof ⇒ Object
readonly
Returns the value of attribute sizeof.
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(name, size, format, opts = {}, &block) ⇒ PackedType
constructor
A new instance of PackedType.
- #instance(val = nil) ⇒ Object
Methods included from Packable
Methods inherited from Type
#claim_value, #container?, #groupable?, #register
Constructor Details
#initialize(name, size, format, opts = {}, &block) ⇒ PackedType
Returns a new instance of PackedType.
66 67 68 69 70 71 |
# File 'lib/rstruct/base_types/packed_type.rb', line 66 def initialize(name, size, format, opts={}, &block) @sizeof = size @format = format @groupable = true super(name, opts, &block) end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
64 65 66 |
# File 'lib/rstruct/base_types/packed_type.rb', line 64 def format @format end |
#sizeof ⇒ Object (readonly)
Returns the value of attribute sizeof.
64 65 66 |
# File 'lib/rstruct/base_types/packed_type.rb', line 64 def sizeof @sizeof end |
Instance Method Details
#instance(val = nil) ⇒ Object
73 74 75 |
# File 'lib/rstruct/base_types/packed_type.rb', line 73 def instance(val=nil) val end |