Class: HMap::HMapBucket Abstract

Inherits:
HMapStructure show all
Defined in:
lib/cocoapods-hmap/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.



124
125
126
127
128
129
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 124

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

Instance Attribute Details

#keyObject

Returns the value of attribute key.



119
120
121
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 119

def key
  @key
end

#perfixObject

Returns the value of attribute perfix.



119
120
121
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 119

def perfix
  @perfix
end

#suffixObject

Returns the value of attribute suffix.



119
120
121
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 119

def suffix
  @suffix
end

#uuidObject

Returns the value of attribute uuid.



119
120
121
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 119

def uuid
  @uuid
end

Instance Method Details

#serializeString

Returns the serialized fields of the mafile.

Returns:

  • (String)

    the serialized fields of the mafile



132
133
134
135
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 132

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

#to_aObject



137
138
139
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 137

def to_a
  [key, perfix, suffix]
end

#to_hObject



141
142
143
144
145
146
147
# File 'lib/cocoapods-hmap/hmap_struct.rb', line 141

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