Class: HMap::HMapBucket Abstract
- Inherits:
-
HMapStructure
- Object
- HMapStructure
- HMap::HMapBucket
- Defined in:
- lib/hmap/hmap/hmap_struct.rb
Overview
This class is abstract.
HMapBucket structure.
Constant Summary collapse
- SIZEOF =
12
- FORMAT =
'L=3'
Constants inherited from HMapStructure
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#perfix ⇒ Object
Returns the value of attribute perfix.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
Instance Method Summary collapse
-
#initialize(key, perfix, suffix) ⇒ HMapBucket
constructor
A new instance of HMapBucket.
-
#serialize ⇒ String
The serialized fields of the mafile.
- #to_a ⇒ Object
- #to_h ⇒ Object
Methods inherited from HMapStructure
bytesize, format, new_from_bin, swapped?
Constructor Details
#initialize(key, perfix, suffix) ⇒ HMapBucket
Returns a new instance of HMapBucket.
128 129 130 131 132 133 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 128 def initialize(key, perfix, suffix) @key = key @perfix = perfix @suffix = suffix super() end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
123 124 125 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 123 def key @key end |
#perfix ⇒ Object
Returns the value of attribute perfix.
123 124 125 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 123 def perfix @perfix end |
#suffix ⇒ Object
Returns the value of attribute suffix.
123 124 125 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 123 def suffix @suffix end |
Instance Method Details
#serialize ⇒ String
Returns the serialized fields of the mafile.
136 137 138 139 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 136 def serialize format = Utils.specialize_format(FORMAT, SWAPPED) [key, perfix, suffix].pack(format) end |
#to_a ⇒ Object
141 142 143 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 141 def to_a [key, perfix, suffix] end |
#to_h ⇒ Object
145 146 147 148 149 150 151 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 145 def to_h { 'key' => key, 'perfix' => perfix, 'suffix' => suffix }.merge super end |