Module: FlatMap::OpenMapper::Persistence::ClassMethods
- Defined in:
- lib/flat_map/open_mapper/persistence.rb
Overview
ModelMethods class macros
Instance Method Summary collapse
-
#build(*traits, &block) ⇒ FlatMap::OpenMapper
Create a new mapper object wrapped around new instance of its
target_class
, with a list of passedtraits
applied to it. -
#target_class ⇒ Class
Default target class for OpenMapper is OpenStruct.
Instance Method Details
#build(*traits, &block) ⇒ FlatMap::OpenMapper
Create a new mapper object wrapped around new instance of its target_class
, with a list of passed traits
applied to it.
23 24 25 |
# File 'lib/flat_map/open_mapper/persistence.rb', line 23 def build(*traits, &block) new(target_class.new, *traits, &block) end |
#target_class ⇒ Class
Default target class for OpenMapper is OpenStruct.
30 31 32 |
# File 'lib/flat_map/open_mapper/persistence.rb', line 30 def target_class OpenStruct end |