module Flatter::Mapper::Collection::FactoryMethods

Public Instance Methods

collection?() click to toggle source
# File lib/flatter/mapper/collection.rb, line 20
def collection?
  options[:collection] == true ||
    (options[:collection] != false && name == name.pluralize)
end
create(*) click to toggle source
Calls superclass method
# File lib/flatter/mapper/collection.rb, line 10
def create(*)
  super.tap do |mapper|
    mapper.options.merge!(collection: collection?)
  end
end
default_mapper_class_name() click to toggle source
Calls superclass method
# File lib/flatter/mapper/collection.rb, line 16
def default_mapper_class_name
  collection? ? "#{name.singularize.camelize}Mapper" : super
end