Class: Vorpal::LookupInstructions
- Inherits:
-
Object
- Object
- Vorpal::LookupInstructions
- Defined in:
- lib/vorpal/db_loader.rb
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize ⇒ LookupInstructions
constructor
A new instance of LookupInstructions.
- #lookup_by_fk(config, fk_info, fk_value) ⇒ Object
- #lookup_by_unique_key(config, column_name, values) ⇒ Object
- #next_lookup ⇒ Object
Constructor Details
Instance Method Details
#empty? ⇒ Boolean
96 97 98 |
# File 'lib/vorpal/db_loader.rb', line 96 def empty? @lookup_by_id.empty? && @lookup_by_fk.empty? end |
#lookup_by_fk(config, fk_info, fk_value) ⇒ Object
84 85 86 |
# File 'lib/vorpal/db_loader.rb', line 84 def lookup_by_fk(config, fk_info, fk_value) @lookup_by_fk.append([config, fk_info], fk_value) end |
#lookup_by_unique_key(config, column_name, values) ⇒ Object
80 81 82 |
# File 'lib/vorpal/db_loader.rb', line 80 def lookup_by_unique_key(config, column_name, values) @lookup_by_id.append([config, column_name], values) end |
#next_lookup ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/vorpal/db_loader.rb', line 88 def next_lookup if @lookup_by_id.empty? pop_fk_lookup else pop_id_lookup end end |