Class: TwitterCldr::Parsers::SymbolTable

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/parsers/symbol_table.rb

Overview

This is really just a thin layer on top of Hash. Nice to have it abstracted in case we have to add custom behavior.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbols = {}) ⇒ SymbolTable

Returns a new instance of SymbolTable.



15
16
17
# File 'lib/twitter_cldr/parsers/symbol_table.rb', line 15

def initialize(symbols = {})
  @symbols = symbols
end

Instance Attribute Details

#symbolsObject (readonly)

Returns the value of attribute symbols.



13
14
15
# File 'lib/twitter_cldr/parsers/symbol_table.rb', line 13

def symbols
  @symbols
end

Instance Method Details

#add(symbol, value) ⇒ Object



23
24
25
# File 'lib/twitter_cldr/parsers/symbol_table.rb', line 23

def add(symbol, value)
  symbols[symbol] = value
end

#fetch(symbol) ⇒ Object



19
20
21
# File 'lib/twitter_cldr/parsers/symbol_table.rb', line 19

def fetch(symbol)
  symbols.fetch(symbol)
end