Module: Decanter::Extensions::ClassMethods
- Defined in:
- lib/decanter/extensions.rb
Instance Method Summary collapse
- #decant(args, options) ⇒ Object
- #decant_create(args, **options) ⇒ Object
- #decant_create!(args, **options) ⇒ Object
- #decant_new(args, **options) ⇒ Object
Instance Method Details
#decant(args, options) ⇒ Object
34 35 36 37 |
# File 'lib/decanter/extensions.rb', line 34 def decant(args, ) .fetch(:decanter, Decanter.decanter_for(self)) .decant(args) end |
#decant_create(args, **options) ⇒ Object
20 21 22 23 |
# File 'lib/decanter/extensions.rb', line 20 def decant_create(args, **) self.new(decant(args, )) .save(context: [:context]) end |
#decant_create!(args, **options) ⇒ Object
29 30 31 32 |
# File 'lib/decanter/extensions.rb', line 29 def decant_create!(args, **) self.new(decant(args, )) .save!(context: [:context]) end |
#decant_new(args, **options) ⇒ Object
25 26 27 |
# File 'lib/decanter/extensions.rb', line 25 def decant_new(args, **) self.new(decant(args, )) end |