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, ids) ⇒ LookupById
constructor
A new instance of LookupById.
- #load_all(db_driver) ⇒ Object
Constructor Details
#initialize(config, ids) ⇒ LookupById
Returns a new instance of LookupById.
118 119 120 121 |
# File 'lib/vorpal/db_loader.rb', line 118 def initialize(config, ids) @config = config @ids = ids end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
117 118 119 |
# File 'lib/vorpal/db_loader.rb', line 117 def config @config end |
Instance Method Details
#load_all(db_driver) ⇒ Object
123 124 125 126 |
# File 'lib/vorpal/db_loader.rb', line 123 def load_all(db_driver) return [] if @ids.empty? db_driver.load_by_id(@config.db_class, @ids) end |