Module: Flatter

Extended by:
Extension::Registrar
Defined in:
lib/flatter.rb,
lib/flatter/mapper.rb,
lib/flatter/mapping.rb,
lib/flatter/version.rb,
lib/flatter/extension.rb,
lib/flatter/mapper/target.rb,
lib/flatter/mapper/traits.rb,
lib/flatter/mapper/factory.rb,
lib/flatter/mapper/mapping.rb,
lib/flatter/mapper/options.rb,
lib/flatter/mapping/scribe.rb,
lib/flatter/mapper/mounting.rb,
lib/flatter/mapping/factory.rb,
lib/flatter/extension/mapper.rb,
lib/flatter/extension/builder.rb,
lib/flatter/extension/factory.rb,
lib/flatter/extension/mapping.rb,
lib/flatter/mapper/collection.rb,
lib/flatter/mapper/model_name.rb,
lib/flatter/mapper/validation.rb,
lib/flatter/mapper/persistence.rb,
lib/flatter/extension/registrar.rb,
lib/flatter/mapper/attribute_methods.rb,
lib/flatter/mapper/write_with_indifferent_access.rb

Defined Under Namespace

Modules: Extension, Extensions Classes: Mapper, Mapping

Constant Summary collapse

VERSION =
"1.0.1"

Constants included from Extension::Registrar

Extension::Registrar::UnknownExtensionError

Class Method Summary collapse

Methods included from Extension::Registrar

extensions, use

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Flatter)

    the object that the method was called on



18
19
20
# File 'lib/flatter.rb', line 18

def self.configure
  yield self
end

.extends(klass, *modules) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/flatter.rb', line 22

def self.extends(klass, *modules)
  if block_given?
    _module = Module.new(&Proc.new)
    klass.const_set("FlatterExtension", _module)
    modules.push _module
  end
  modules.each{ |mod| klass.send(:include, mod) }
end