Class: TwitterCldr::Parsers::SymbolTable
- Inherits:
-
Object
- Object
- TwitterCldr::Parsers::SymbolTable
- 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
-
#symbols ⇒ Object
readonly
Returns the value of attribute symbols.
Instance Method Summary collapse
- #add(symbol, value) ⇒ Object
- #fetch(symbol) ⇒ Object
-
#initialize(symbols = {}) ⇒ SymbolTable
constructor
A new instance of SymbolTable.
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
#symbols ⇒ Object (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 |