Class: Stone::Siclos::Client::Response
- Inherits:
-
Object
- Object
- Stone::Siclos::Client::Response
- Defined in:
- lib/stone/siclos/client.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(code, data) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(code, data) ⇒ Response
Returns a new instance of Response.
20 21 22 23 24 |
# File 'lib/stone/siclos/client.rb', line 20 def initialize(code, data) @code = code @data = JSON.parse(data, symbolize_names: true) raise_exception unless @data[:success] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
18 19 20 |
# File 'lib/stone/siclos/client.rb', line 18 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
17 18 19 |
# File 'lib/stone/siclos/client.rb', line 17 def data @data end |
Instance Method Details
#success? ⇒ Boolean
26 27 28 |
# File 'lib/stone/siclos/client.rb', line 26 def success? @data[:success] end |