Class: Legs::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/legs.rb

Overview

represents the data response, handles throwing of errors and stuff

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



375
376
377
# File 'lib/legs.rb', line 375

def data
  @data
end

Instance Method Details

#resultObject 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