Class: Osmer::Schema::Custom::Table::Dsl

Inherits:
Struct
  • Object
show all
Includes:
Utils
Defined in:
lib/osmer/schema/custom.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#camelize, #underscore

Instance Attribute Details

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of table



168
169
170
# File 'lib/osmer/schema/custom.rb', line 168

def table
  @table
end

Instance Method Details

#map(*args) ⇒ Object



172
173
174
# File 'lib/osmer/schema/custom.rb', line 172

def map(*args)
  table.mappers[:type].add_args(*args)
end

#with(*args) ⇒ Object



176
177
178
179
180
181
182
183
184
# File 'lib/osmer/schema/custom.rb', line 176

def with(*args)
  args.each do |arg|
    if arg.is_a? Hash
      arg.each(&method(:add_mapper))
    else
      add_mapper arg, arg
    end
  end
end