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, 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

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