class Humble::MappingConfigurationBuilder

Public Class Methods

new(attributes = {}, table = DatabaseTable.new) click to toggle source
# File lib/humble/mapping_configuration_builder.rb, line 3
def initialize(attributes = {}, table = DatabaseTable.new)
  @attributes = attributes
  @table = table
end

Public Instance Methods

build() click to toggle source
# File lib/humble/mapping_configuration_builder.rb, line 26
def build
  MappingConfiguration.new(@attributes, @table)
end
column(name) click to toggle source
# File lib/humble/mapping_configuration_builder.rb, line 22
def column(name)
  @table.add_column(name)
end
primary_key(name, default: 0) click to toggle source
# File lib/humble/mapping_configuration_builder.rb, line 17
def primary_key(name, default: 0)
  @attributes[:primary_key] = name
  @table.primary_key(name, default: default)
end
table(name) click to toggle source
# File lib/humble/mapping_configuration_builder.rb, line 8
def table(name)
  @attributes[:table] = name
  @table.named(name)
end
type(name) click to toggle source
# File lib/humble/mapping_configuration_builder.rb, line 13
def type(name)
  @attributes[:type] = name
end