Method: EurekaBot::Controller#execute

Defined in:
lib/eureka_bot/controller.rb

#execute(action) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/eureka_bot/controller.rb', line 21

def execute(action)
  if respond_to?(action, include_all: false)
    instrument 'controller.execute' do
      run_callbacks :action do
        public_send(action)
      end
    end
  else
    raise UnknownAction.new("Action #{action} is not defined in #{self.class}")
  end
  self
end