Class: Postscale::Result
- Inherits:
-
Object
- Object
- Postscale::Result
- Defined in:
- lib/postscale/response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize(data:, error:, headers:) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(data:, error:, headers:) ⇒ Result
Returns a new instance of Result.
24 25 26 27 28 |
# File 'lib/postscale/response.rb', line 24 def initialize(data:, error:, headers:) @data = data @error = error @headers = headers end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
22 23 24 |
# File 'lib/postscale/response.rb', line 22 def data @data end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
22 23 24 |
# File 'lib/postscale/response.rb', line 22 def error @error end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
22 23 24 |
# File 'lib/postscale/response.rb', line 22 def headers @headers end |
Instance Method Details
#success? ⇒ Boolean
30 31 32 |
# File 'lib/postscale/response.rb', line 30 def success? @error.nil? end |