Class: Quby::LookupTable
- Inherits:
-
Object
- Object
- Quby::LookupTable
- Defined in:
- lib/quby/lookup_table.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #backing ⇒ Object
- #data ⇒ Object
-
#initialize(key) ⇒ LookupTable
constructor
A new instance of LookupTable.
- #lookup(parameters) ⇒ Object
Constructor Details
#initialize(key) ⇒ LookupTable
Returns a new instance of LookupTable.
9 10 11 |
# File 'lib/quby/lookup_table.rb', line 9 def initialize(key) @key = key end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/quby/lookup_table.rb', line 7 def key @key end |
Instance Method Details
#backing ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/quby/lookup_table.rb', line 13 def backing return @backing if @backing.present? all_data = data headers = all_data.shift compare = all_data.shift @backing = Quby::TableBackend::RangeTree.new(headers, compare, all_data) end |
#data ⇒ Object
25 26 27 |
# File 'lib/quby/lookup_table.rb', line 25 def data Quby.lookup_table_repo.retrieve(key) end |
#lookup(parameters) ⇒ Object
21 22 23 |
# File 'lib/quby/lookup_table.rb', line 21 def lookup(parameters) backing.lookup(parameters) end |