Class: BetfairApiNgRails::Api::Http::Responser

Inherits:
Object
  • Object
show all
Includes:
Constants, Helpers::InformationResponse, Helpers::KeepAliveResponse, Helpers::SessionResponse
Defined in:
lib/betfair_api_ng_rails/api/http/responser.rb

Constant Summary

Constants included from Constants

Constants::ALLOWED_FORMATTING, Constants::ALLOWED_RESOURCES, Constants::API_REQUEST_HEADERS, Constants::JSON_METHOD, Constants::KEEP_ALIVE_URL, Constants::LOADABLE_CONFIG_OPTIONS, Constants::SESSION_REQUEST_HEADERS, Constants::SIMPLE_LISTING_FILTERED, Constants::SUCCESS_LOGIN

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::SessionResponse

included, #session_token

Methods included from Helpers::KeepAliveResponse

included

Methods included from Helpers::InformationResponse

#api_result, included

Constructor Details

#initialize(response) ⇒ Responser

Returns a new instance of Responser.



14
15
16
# File 'lib/betfair_api_ng_rails/api/http/responser.rb', line 14

def initialize(response)
  @response = response
end

Instance Attribute Details

#error_infoObject (readonly)

Returns the value of attribute error_info.



12
13
14
# File 'lib/betfair_api_ng_rails/api/http/responser.rb', line 12

def error_info
  @error_info
end

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/betfair_api_ng_rails/api/http/responser.rb', line 12

def response
  @response
end

Instance Method Details

#has_error?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/betfair_api_ng_rails/api/http/responser.rb', line 24

def has_error?
  http_error?
end

#resultObject



18
19
20
21
22
# File 'lib/betfair_api_ng_rails/api/http/responser.rb', line 18

def result
  JSON.parse response.body
rescue
  raise BetfairApiNgRails::BadResponseError
end