Module: Flatter::Mapper::Traits::FactoryMethods
- Included in:
- Factory
- Defined in:
- lib/flatter/mapper/traits.rb
Instance Attribute Summary collapse
-
#extension ⇒ Object
Returns the value of attribute extension.
Instance Method Summary collapse
Instance Attribute Details
#extension ⇒ Object
Returns the value of attribute extension.
6 7 8 |
# File 'lib/flatter/mapper/traits.rb', line 6 def extension @extension end |
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/flatter/mapper/traits.rb', line 16 def create(*) super.tap do |mounting| mounting.set_traits(traits) mounting.trait! if trait? mounting.extend_with(extension) if extension.present? end end |
#trait? ⇒ Boolean
12 13 14 |
# File 'lib/flatter/mapper/traits.rb', line 12 def trait? !![:trait] end |
#traits ⇒ Object
8 9 10 |
# File 'lib/flatter/mapper/traits.rb', line 8 def traits Array([:traits]) end |