Class: Vorpal::LookupById

Inherits:
Object
  • Object
show all
Defined in:
lib/vorpal/db_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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