Class: HMap::HMapBucket Abstract

Inherits:
HMapStructure show all
Defined in:
lib/cocoapods-hmap-prebuilt/hmap_struct.rb

Overview

This class is abstract.

HMapBucket structure.

Constant Summary collapse

SIZEOF =
12
FORMAT =
'L=3'

Constants inherited from HMapStructure

HMap::HMapStructure::SWAPPED

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HMapStructure

bytesize, format, new_from_bin, swapped?

Constructor Details

#initialize(key, perfix, suffix) ⇒ HMapBucket

Returns a new instance of HMapBucket.



175
176
177
178
179
180
# File 'lib/cocoapods-hmap-prebuilt/hmap_struct.rb', line 175

def initialize(key, perfix, suffix)
  @key = key
  @perfix = perfix
  @suffix = suffix
  super()
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



169
170
171
# File 'lib/cocoapods-hmap-prebuilt/hmap_struct.rb', line 169

def key
  @key
end

#perfixObject

Returns the value of attribute perfix.



169
170
171
# File 'lib/cocoapods-hmap-prebuilt/hmap_struct.rb', line 169

def perfix
  @perfix
end

#suffixObject

Returns the value of attribute suffix.



169
170
171
# File 'lib/cocoapods-hmap-prebuilt/hmap_struct.rb', line 169

def suffix
  @suffix
end

Instance Method Details

#serializeString

Returns the serialized fields of the mafile.

Returns:

  • (String)

    the serialized fields of the mafile



183
184
185
186
# File 'lib/cocoapods-hmap-prebuilt/hmap_struct.rb', line 183

def serialize
  format = Utils.specialize_format(FORMAT, SWAPPED)
  [key, perfix, suffix].pack(format)
end

#to_aObject



188
189
190
# File 'lib/cocoapods-hmap-prebuilt/hmap_struct.rb', line 188

def to_a
  [key, perfix, suffix]
end

#to_hObject



192
193
194
195
196
197
198
# File 'lib/cocoapods-hmap-prebuilt/hmap_struct.rb', line 192

def to_h
  {
    'key' => key,
    'perfix' => perfix,
    'suffix' => suffix
  }.merge super
end