Class: HMap::BucketStr

Inherits:
Object
  • Object
show all
Defined in:
lib/hmap/hmap/hmap_bucketstr.rb

Overview

hmap bucket string

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, perfix, suffix) ⇒ BucketStr

Returns a new instance of BucketStr.



8
9
10
11
12
# File 'lib/hmap/hmap/hmap_bucketstr.rb', line 8

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

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



6
7
8
# File 'lib/hmap/hmap/hmap_bucketstr.rb', line 6

def key
  @key
end

#perfixObject (readonly)

Returns the value of attribute perfix.



6
7
8
# File 'lib/hmap/hmap/hmap_bucketstr.rb', line 6

def perfix
  @perfix
end

#suffixObject (readonly)

Returns the value of attribute suffix.



6
7
8
# File 'lib/hmap/hmap/hmap_bucketstr.rb', line 6

def suffix
  @suffix
end

Instance Method Details

#descriptionObject



22
23
24
25
26
# File 'lib/hmap/hmap/hmap_bucketstr.rb', line 22

def description
  "Key \#{@key} -> Prefix \#{@perfix}, Suffix \#{@suffix}\n"
end

#to_aObject



18
19
20
# File 'lib/hmap/hmap/hmap_bucketstr.rb', line 18

def to_a
  [key, perfix, suffix]
end

#valueObject



14
15
16
# File 'lib/hmap/hmap/hmap_bucketstr.rb', line 14

def value
  [perfix, suffix]
end