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.



392
# File 'lib/legs.rb', line 392

def initialize(data); @data = data; end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



391
392
393
# File 'lib/legs.rb', line 391

def data
  @data
end

Instance Method Details

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