class Gumdrop::Data::SqliteLiveData

Attributes

db[R]
provider[R]

Public Class Methods

new(db, provider) click to toggle source
# File lib/gumdrop/data_providers/sqlite.rb, line 23
def initialize(db, provider)
  @db= db
  @provider= provider
  @data_hash= Hash.new &method(:load_data_for)
end

Public Instance Methods

load_data_for(hash, table_name) click to toggle source
# File lib/gumdrop/data_providers/sqlite.rb, line 29
def load_data_for(hash, table_name)
  data=[]
  db.results_as_hash = true
  db.execute( "select * from #{ table_name.to_s };" ) do |row|
    data << row.reject {|key,col| key.is_a? Fixnum }
  end
  hash[table_name]= provider.supply_data data
end
method_missing(key, *args) click to toggle source
# File lib/gumdrop/data_providers/sqlite.rb, line 38
def method_missing(key, *args)
  @data_hash[key]
end