Class: Osmer::Schema::Custom::Table
- Inherits:
-
Object
- Object
- Osmer::Schema::Custom::Table
- Includes:
- Configurable
- Defined in:
- lib/osmer/schema/custom.rb
Defined Under Namespace
Classes: Dsl
Instance Attribute Summary collapse
-
#mappers ⇒ Object
readonly
Returns the value of attribute mappers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#source_schema ⇒ Object
readonly
Returns the value of attribute source_schema.
-
#source_table ⇒ Object
readonly
Returns the value of attribute source_table.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(schema, name, type, options) ⇒ Table
constructor
A new instance of Table.
- #projection ⇒ Object
Methods included from Configurable
Constructor Details
#initialize(schema, name, type, options) ⇒ Table
Returns a new instance of Table.
149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/osmer/schema/custom.rb', line 149 def initialize(schema, name, type, ) require 'osmer/mapper/type' require 'osmer/mapper/name' @schema, @name, @type = schema, name, type @source_table = type.to_s.gsub(/\Amulti/,'') @source_schema = schema.ns.find_schema([:source] || schema.source || :source) or raise StandardError.new("Source schema not found") @mappers = { :type => Osmer::Mapper::Type.new(self, :type), :name => Osmer::Mapper::Name.new(self, :name) } end |
Instance Attribute Details
#mappers ⇒ Object (readonly)
Returns the value of attribute mappers.
147 148 149 |
# File 'lib/osmer/schema/custom.rb', line 147 def mappers @mappers end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
147 148 149 |
# File 'lib/osmer/schema/custom.rb', line 147 def name @name end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
147 148 149 |
# File 'lib/osmer/schema/custom.rb', line 147 def schema @schema end |
#source_schema ⇒ Object (readonly)
Returns the value of attribute source_schema.
147 148 149 |
# File 'lib/osmer/schema/custom.rb', line 147 def source_schema @source_schema end |
#source_table ⇒ Object (readonly)
Returns the value of attribute source_table.
147 148 149 |
# File 'lib/osmer/schema/custom.rb', line 147 def source_table @source_table end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
147 148 149 |
# File 'lib/osmer/schema/custom.rb', line 147 def type @type end |
Instance Method Details
#projection ⇒ Object
164 165 166 |
# File 'lib/osmer/schema/custom.rb', line 164 def projection schema.projection end |