Sha256: db3f9e7f60a02c4a2d6261bcb6131939945e117889825161fee5159a45c1895d
Contents?: true
Size: 832 Bytes
Versions: 1
Compression:
Stored size: 832 Bytes
Contents
module ROM class Boot class BaseRelationDSL attr_reader :env, :name, :header def initialize(env, name) @env = env @name = name @header = [] end def repository(name = nil) if @repository @repository else @repository = env[name] end end def attribute(name) header << name end def call(&block) instance_exec(&block) dataset = if adapter.respond_to?(:dataset) adapter.dataset(name, header) else adapter[name] end base_header = dataset.respond_to?(:header) ? dataset.header : header [name, dataset, base_header] end private def adapter repository.adapter end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rom-0.4.1 | lib/rom/boot/base_relation_dsl.rb |