Class: FfcrmEndpoint::Endpoint
- Inherits:
-
Object
- Object
- FfcrmEndpoint::Endpoint
- Defined in:
- lib/ffcrm_endpoint/endpoint.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#authenticate ⇒ Object
The authentication method is called by the endpoint controller before ‘process’ is run.
-
#initialize(params) ⇒ Endpoint
constructor
A new instance of Endpoint.
-
#process ⇒ Object
The main function to process the incoming data.
Constructor Details
#initialize(params) ⇒ Endpoint
Returns a new instance of Endpoint.
14 15 16 17 |
# File 'lib/ffcrm_endpoint/endpoint.rb', line 14 def initialize(params) @params = params raise EndpointNoActionError, "No action defined." unless params[:klass_name].present? end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
9 10 11 |
# File 'lib/ffcrm_endpoint/endpoint.rb', line 9 def params @params end |
Instance Method Details
#authenticate ⇒ Object
The authentication method is called by the endpoint controller before ‘process’ is run. ‘process’ will only be called if authenticate returns true
29 30 31 |
# File 'lib/ffcrm_endpoint/endpoint.rb', line 29 def authenticate klass.new(params).authenticate == true end |
#process ⇒ Object
The main function to process the incoming data. It delegates to the process function in your custom endpoint class.
22 23 24 |
# File 'lib/ffcrm_endpoint/endpoint.rb', line 22 def process klass.new(params).process end |