module Decanter::Extensions
Public Class Methods
included(base)
click to toggle source
# File lib/decanter/extensions.rb, line 3 def self.included(base) base.extend(ClassMethods) end
Public Instance Methods
decant(args, **options)
click to toggle source
# File lib/decanter/extensions.rb, line 17 def decant(args, **options) self.class.decant(args, options) end
decant_update(args, **options)
click to toggle source
# File lib/decanter/extensions.rb, line 7 def decant_update(args, **options) self.attributes = self.class.decant(args, options) self.save(context: options[:context]) end
decant_update!(args, **options)
click to toggle source
# File lib/decanter/extensions.rb, line 12 def decant_update!(args, **options) self.attributes = self.class.decant(args, options) self.save!(context: options[:context]) end