Class: HollaBack::Response
- Inherits:
-
Object
- Object
- HollaBack::Response
- Includes:
- OptionLoader
- Defined in:
- lib/holla_back/response.rb
Overview
The main class for providing response objects
Instance Attribute Summary collapse
-
#responding_methods ⇒ Hash
Responding_methods - The hash of key (method) value (return) pairs.
-
#responding_object ⇒ Object
Responding_object - The responding object.
-
#status_message ⇒ String
Status_message - The status message for the response.
Instance Method Summary collapse
-
#initialize(responding_obj = nil, options) ⇒ Response
constructor
A new instance of HollaBack::Response.
-
#successful? ⇒ Boolean
The status of success.
Methods included from OptionLoader
Constructor Details
#initialize(responding_obj = nil, options) ⇒ Response
A new instance of HollaBack::Response
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/holla_back/response.rb', line 23 def initialize(responding_obj=nil, ) = { responding_methods: [], success_message: nil, failure_message: nil }.merge() (, :responding_methods, :status_method, :success_message, :failure_message) self.responding_object = responding_obj set_response! end |
Instance Attribute Details
#responding_methods ⇒ Hash
Returns responding_methods - The hash of key (method) value (return) pairs.
10 11 12 |
# File 'lib/holla_back/response.rb', line 10 def responding_methods @responding_methods end |
#responding_object ⇒ Object
Returns responding_object - The responding object.
8 9 10 |
# File 'lib/holla_back/response.rb', line 8 def responding_object @responding_object end |
#status_message ⇒ String
Returns status_message - The status message for the response.
12 13 14 |
# File 'lib/holla_back/response.rb', line 12 def @status_message end |
Instance Method Details
#successful? ⇒ Boolean
The status of success
42 43 44 |
# File 'lib/holla_back/response.rb', line 42 def successful? !!get_status_method end |