Module: Cabot::Show

Defined in:
lib/cabot.rb

Overview

GET /:id

Class Method Summary collapse

Class Method Details

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



21
22
23
24
25
26
27
28
29
# File 'lib/cabot.rb', line 21

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

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