Class: UwCatalog::DataLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/uw_catalog/data_loader.rb

Class Method Summary collapse

Class Method Details

.get_data(repository_key, sql, bibid) ⇒ Object



16
17
18
# File 'lib/uw_catalog/data_loader.rb', line 16

def self.get_data(repository_key, sql, bibid)
  repository(repository_key).adapter.select(sql, bibid)
end

.load(data_struct, obj) ⇒ Object



12
13
14
# File 'lib/uw_catalog/data_loader.rb', line 12

def self.load(data_struct, obj)
  data_struct.each_pair {|key, value| obj.send("#{key}=",value) }
end

.load_dynamic_object(data_struct, class_name) ⇒ Object



5
6
7
8
9
10
# File 'lib/uw_catalog/data_loader.rb', line 5

def self.load_dynamic_object(data_struct, class_name)
  cls = Object.const_get(class_name)
  obj = cls.new
  data_struct.each_pair {|key, value| obj.send("#{key}=",value) }
  obj
end