Module: Cabot::Update

Defined in:
lib/cabot.rb

Overview

PUT

Class Method Summary collapse

Class Method Details

.call(model, current_user = {}, options = {}) ⇒ Object



52
53
54
55
56
57
58
59
60
# File 'lib/cabot.rb', line 52

def self.call(model, current_user = {}, options = {})
  object = model.to_s.camelize.constantize
  params = Cabot::Parameters::Update.send(model)
  options.each do |key, value|
    params[key] = value
  end

  Cabot.new(object::Update.(params, current_user: current_user))
end