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.
376 |
# File 'lib/legs.rb', line 376 def initialize(data); @data = data; end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
375 376 377 |
# File 'lib/legs.rb', line 375 def data @data end |
Instance Method Details
#result ⇒ Object Also known as: value
377 378 379 380 381 382 383 |
# File 'lib/legs.rb', line 377 def result unless @data['error'].nil? or @errored @errored = true raise @data['error'] end @data['result'] end |