Module: ActiveCrew::Respondable

Included in:
Base
Defined in:
lib/active_crew/concerns/respondable.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



14
15
16
17
18
# File 'lib/active_crew/concerns/respondable.rb', line 14

def execute
  super
rescue CommandError
  respond_with $ERROR_INFO
end

#respond_fail(*args) ⇒ Object



10
11
12
# File 'lib/active_crew/concerns/respondable.rb', line 10

def respond_fail(*args)
  fail CommandError, I18n.t(*args)
end

#respond_with(model, options = {}) ⇒ Object



5
6
7
8
# File 'lib/active_crew/concerns/respondable.rb', line 5

def respond_with(model, options = {})
  name = options.delete(:name) || self.name
  Responders.respond_with name, invoker, context.merge(options), model
end