Module: Mappy
- Defined in:
- lib/mappy.rb,
lib/mappy/version.rb,
lib/mappy/resolver.rb,
lib/mappy/map_store.rb,
lib/mappy/exceptions.rb,
lib/mappy/configuration.rb,
lib/mappy/target_builder_factory.rb
Defined Under Namespace
Classes: InvalidTargetBuilder, MapNotFound
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Registers a collection of maps.
- .finalize! ⇒ Object deprecated Deprecated.
-
.map(source, options = {}) ⇒ Object
Converts the source object to an instance of the options.
-
.reset! ⇒ Object
Because sometimes, when you are testing things, you might want a new configuration.
-
.to_type(object) ⇒ String
Determines the object’s Mappy type.
Class Attribute Details
.configuration ⇒ Object
7 8 9 |
# File 'lib/mappy.rb', line 7 def configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|config| ... } ⇒ Object
Registers a collection of maps.
34 35 36 |
# File 'lib/mappy.rb', line 34 def configure(&block) yield(configuration) end |
.finalize! ⇒ Object
Deprecated.
60 61 |
# File 'lib/mappy.rb', line 60 def finalize! end |
.map(source, options = {}) ⇒ Object
Converts the source object to an instance of the options.
55 56 57 |
# File 'lib/mappy.rb', line 55 def map(source, = {}) configuration.map(source, ) end |
.reset! ⇒ Object
Because sometimes, when you are testing things, you might want a new configuration. :nodoc:
66 67 68 |
# File 'lib/mappy.rb', line 66 def reset! self.configuration = Configuration.new end |
.to_type(object) ⇒ String
Determines the object’s Mappy type
20 21 22 23 |
# File 'lib/mappy.rb', line 20 def to_type(object) return object.to_mappy_type if object.respond_to?(:to_mappy_type) object.class.to_s.underscore end |