class ROM::FMP::Gateway
Attributes
database[R]
datasets[R]
sets[R]
Public Class Methods
new(*options)
click to toggle source
# File lib/rom/fmp/gateway.rb, line 10 def initialize(*options) @database = Rfm.database(options[0].to_h.merge(FMRESULTSET_TEMPLATE).to_h) @datasets = Hash.new end
Public Instance Methods
connect(*args)
click to toggle source
# File lib/rom/fmp/mini.rb, line 41 def connect(*args) options = args.last.kind_of?(Hash) ? args.pop : Hash.new options.merge! args.pop if args.last.kind_of?(Hash) case args[0] when Rfm::Database args[0] else #::Rfm::Database.new(uri[:database], *Array([uri.to_s, *args]).flatten) #Rfm.layout(storage_name, gateway.adapter.options.merge(FMRESULTSET_TEMPLATE).symbolize_keys) Rfm.database(*args, options.to_h.merge(FMRESULTSET_TEMPLATE).to_h) end end
dataset(name)
click to toggle source
# File lib/rom/fmp/gateway.rb, line 15 def dataset(name) datasets[name.to_s] ||= Dataset.new(@database[name.to_s]) end
Also aliased as: [], [], []
dataset?(name)
click to toggle source
# File lib/rom/fmp/gateway.rb, line 22 def dataset?(name) datasets.key?(name.to_s) end