Class: TwitterCldr::Segmentation::StatusTable

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/segmentation/status_table.rb

Constant Summary collapse

PACK_FMT =
'I!*'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values) ⇒ StatusTable

Returns a new instance of StatusTable.



21
22
23
# File 'lib/twitter_cldr/segmentation/status_table.rb', line 21

def initialize(values)
  @values = values
end

Instance Attribute Details

#valuesObject (readonly)

Returns the value of attribute values.



19
20
21
# File 'lib/twitter_cldr/segmentation/status_table.rb', line 19

def values
  @values
end

Class Method Details

.load(hash) ⇒ Object



14
15
16
# File 'lib/twitter_cldr/segmentation/status_table.rb', line 14

def load(hash)
  new(Base64.decode64(hash[:table]).unpack(PACK_FMT))
end

Instance Method Details

#dumpObject



25
26
27
# File 'lib/twitter_cldr/segmentation/status_table.rb', line 25

def dump
  { table: Base64.encode64(values.pack(PACK_FMT)).strip }
end