Class: Vorpal::LookupById
- Inherits:
-
Object
- Object
- Vorpal::LookupById
- Defined in:
- lib/vorpal/db_loader.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config, column_name, ids) ⇒ LookupById
constructor
A new instance of LookupById.
- #load_all(db_driver) ⇒ Object
Constructor Details
#initialize(config, column_name, ids) ⇒ LookupById
Returns a new instance of LookupById.
120 121 122 123 124 |
# File 'lib/vorpal/db_loader.rb', line 120 def initialize(config, column_name, ids) @config = config @column_name = column_name @ids = ids end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
119 120 121 |
# File 'lib/vorpal/db_loader.rb', line 119 def config @config end |
Instance Method Details
#load_all(db_driver) ⇒ Object
126 127 128 129 |
# File 'lib/vorpal/db_loader.rb', line 126 def load_all(db_driver) return [] if @ids.empty? db_driver.load_by_unique_key(@config.db_class, @ids, @column_name) end |