Class: HMap::HMapData
- Inherits:
-
Object
- Object
- HMap::HMapData
- Defined in:
- lib/hmap/hmap/hmap_struct.rb
Overview
HMap blobs.
Instance Method Summary collapse
-
#initialize(strings, buckets, entries) ⇒ HMapData
constructor
A new instance of HMapData.
-
#serialize ⇒ String
The serialized fields of the mafile.
Constructor Details
#initialize(strings, buckets, entries) ⇒ HMapData
Returns a new instance of HMapData.
156 157 158 159 160 161 162 163 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 156 def initialize(strings, buckets, entries) super() return if strings.nil? || buckets.empty? @buckets = buckets @strings = strings @header = populate_hmap_header(buckets.count, entries) end |
Instance Method Details
#serialize ⇒ String
Returns the serialized fields of the mafile.
166 167 168 169 170 |
# File 'lib/hmap/hmap/hmap_struct.rb', line 166 def serialize return EMPTY_HMAP if @strings.nil? @header.serialize + @buckets.join + @strings end |