Class: Lookup
- Inherits:
-
Object
- Object
- Lookup
- Defined in:
- lib/jungle_path/app/ztools/zport_data.rb
Instance Method Summary collapse
-
#initialize(db) ⇒ Lookup
constructor
A new instance of Lookup.
- #value(table, value, search_column, target_column) ⇒ Object
Constructor Details
#initialize(db) ⇒ Lookup
Returns a new instance of Lookup.
206 207 208 209 210 211 |
# File 'lib/jungle_path/app/ztools/zport_data.rb', line 206 def initialize(db) @target_db = db @current_user = nil @current_key = nil @lookups = {} end |
Instance Method Details
#value(table, value, search_column, target_column) ⇒ Object
213 214 215 216 217 |
# File 'lib/jungle_path/app/ztools/zport_data.rb', line 213 def value table, value, search_column, target_column key = "#{table}.#{search_column}" @lookups[key] = load_lookup(table, search_column, target_column) unless @lookups[key] @lookups[key][value] end |