Class: Legs::Result
- Inherits:
-
Object
- Object
- Legs::Result
- Defined in:
- lib/legs.rb
Overview
represents the data response, handles throwing of errors and stuff
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Result
constructor
A new instance of Result.
- #result ⇒ Object (also: #value)
Constructor Details
#initialize(data) ⇒ Result
Returns a new instance of Result.
392 |
# File 'lib/legs.rb', line 392 def initialize(data); @data = data; end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
391 392 393 |
# File 'lib/legs.rb', line 391 def data @data end |
Instance Method Details
#result ⇒ Object Also known as: value
393 394 395 396 397 398 399 |
# File 'lib/legs.rb', line 393 def result unless @data['error'].nil? or @errored @errored = true raise @data['error'] end @data['result'] end |