Module: Cabot::Show

Defined in:
lib/cabot.rb

Overview

GET /:id

Class Method Summary collapse

Class Method Details

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



26
27
28
29
30
31
32
33
34
# File 'lib/cabot.rb', line 26

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

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