Class: SurveyGizmo::Resource::Response
- Inherits:
-
Object
- Object
- SurveyGizmo::Resource::Response
- Defined in:
- lib/survey_gizmo/resource.rb
Overview
This class normalizes the response returned by Survey Gizmo
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#data ⇒ Object
The parsed JSON data of the response.
-
#message ⇒ Object
The error message if there is one.
- #ok? ⇒ Boolean
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
265 266 267 |
# File 'lib/survey_gizmo/resource.rb', line 265 def response @response end |
Instance Method Details
#data ⇒ Object
The parsed JSON data of the response
256 257 258 |
# File 'lib/survey_gizmo/resource.rb', line 256 def data @_data ||= (@response['data'] || {}) end |
#message ⇒ Object
The error message if there is one
261 262 263 |
# File 'lib/survey_gizmo/resource.rb', line 261 def @_message ||= @response['message'] end |
#ok? ⇒ Boolean
251 252 253 |
# File 'lib/survey_gizmo/resource.rb', line 251 def ok? @response && @response['result_ok'] end |