Class: Mailtrain::Response
- Inherits:
-
Object
- Object
- Mailtrain::Response
- Defined in:
- lib/mailtrain/response.rb
Instance Method Summary collapse
- #data ⇒ Object
- #error_message ⇒ Object
-
#initialize(json) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(json) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/mailtrain/response.rb', line 5 def initialize(json) @res = symbolize_keys(JSON.parse(json)) end |
Instance Method Details
#data ⇒ Object
17 18 19 |
# File 'lib/mailtrain/response.rb', line 17 def data @res[:data] end |
#error_message ⇒ Object
13 14 15 |
# File 'lib/mailtrain/response.rb', line 13 def @res[:error] end |
#success? ⇒ Boolean
9 10 11 |
# File 'lib/mailtrain/response.rb', line 9 def success? @res[:error].nil? end |