Class: Wegift::Response
- Inherits:
-
Object
- Object
- Wegift::Response
- Includes:
- Initializable
- Defined in:
- lib/wegift/models/response.rb
Constant Summary collapse
- STATUS =
{:success => 'SUCCESS', :error => 'ERROR'}
Instance Attribute Summary collapse
-
#error_code ⇒ Object
global shared body.
-
#error_details ⇒ Object
global shared body.
-
#error_string ⇒ Object
global shared body.
-
#status ⇒ Object
global shared body.
Instance Method Summary collapse
Methods included from Initializable
Instance Attribute Details
#error_code ⇒ Object
global shared body
16 17 18 |
# File 'lib/wegift/models/response.rb', line 16 def error_code @error_code end |
#error_details ⇒ Object
global shared body
16 17 18 |
# File 'lib/wegift/models/response.rb', line 16 def error_details @error_details end |
#error_string ⇒ Object
global shared body
16 17 18 |
# File 'lib/wegift/models/response.rb', line 16 def error_string @error_string end |
#status ⇒ Object
global shared body
16 17 18 |
# File 'lib/wegift/models/response.rb', line 16 def status @status end |
Instance Method Details
#is_successful? ⇒ Boolean
18 19 20 |
# File 'lib/wegift/models/response.rb', line 18 def is_successful? @status && @status.eql?(STATUS[:success]) end |
#parse(data = {}) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/wegift/models/response.rb', line 22 def parse(data = {}) @status = data['status'] @error_code = data['error_code'] @error_string = data['error_string'] @error_details = data['error_details'] end |