class Humble::MappingConfiguration

Public Class Methods

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

Public Instance Methods

[](key) click to toggle source
# File lib/humble/mapping_configuration.rb, line 24
def [](key)
  @attributes[key]
end
delete_using(connection, entity) click to toggle source
# File lib/humble/mapping_configuration.rb, line 16
def delete_using(connection, entity)
  @table.destroy(connection, entity)
end
find_all_using(connection) click to toggle source
# File lib/humble/mapping_configuration.rb, line 8
def find_all_using(connection)
  ResultSet.new(connection[@table.name], mapper)
end
matches?(item) click to toggle source
# File lib/humble/mapping_configuration.rb, line 20
def matches?(item)
  self[:type] == item || item.is_a?(self[:type])
end
save_using(connection, entity) click to toggle source
# File lib/humble/mapping_configuration.rb, line 12
def save_using(connection, entity)
  @table.persist(connection, entity)
end

Private Instance Methods

mapper() click to toggle source
# File lib/humble/mapping_configuration.rb, line 30
def mapper
  self[:mapper] || DefaultDataRowMapper.new(self)
end