Class: ActiveFunction::Base
- Defined in:
- lib/active_function/base.rb
Overview
The main base class for defining functions using the ActiveFunction framework. Public methods of this class are considered as actions and be proceeded on Base.process call.
Constant Summary collapse
- Error =
Class.new(StandardError)
Instance Attribute Summary
Attributes inherited from SuperBase
#action_name, #request, #response
Class Method Summary collapse
-
.process(action_name, request = {}, response = Response.new) ⇒ Object
Processes specified action and returns Hash’ed Functions::Response::Response object.
Methods inherited from SuperBase
#dispatch, #initialize, #process
Constructor Details
This class inherits a constructor from ActiveFunction::SuperBase
Class Method Details
.process(action_name, request = {}, response = Response.new) ⇒ Object
Processes specified action and returns Hash’ed Functions::Response::Response object.
52 53 54 55 56 |
# File 'lib/active_function/base.rb', line 52 def self.process(action_name, request = {}, response = Response.new) raise ArgumentError, "Action method #{action_name} is not defined" unless method_defined?(action_name) new(action_name, request, response).dispatch end |