Sha256: 5340c551c908ee1690798edec0c070c8010224bc83ff6cbcccf41b53fd8f4201
Contents?: true
Size: 787 Bytes
Versions: 2
Compression:
Stored size: 787 Bytes
Contents
module ROM # Setup DSL-specific mapper extensions # # @private class Mapper # Generate a mapper subclass # # This is used by Setup#mappers DSL # # @api private def self.build_class(name, options = EMPTY_HASH, &block) class_name = "ROM::Mapper[#{name}]" parent = options[:parent] inherit_header = options.fetch(:inherit_header) { Mapper.inherit_header } parent_class = if parent ROM.boot.mapper_classes.detect { |klass| klass.relation == parent } else self end ClassBuilder.new(name: class_name, parent: parent_class).call do |klass| klass.relation(name) klass.inherit_header(inherit_header) klass.class_eval(&block) if block end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rom-0.9.1 | lib/rom/setup_dsl/mapper.rb |
rom-0.9.0 | lib/rom/setup_dsl/mapper.rb |