Class: BetfairApiNgRails::Api::Http::Responser
- Inherits:
-
Object
- Object
- BetfairApiNgRails::Api::Http::Responser
- 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
-
#error_info ⇒ Object
readonly
Returns the value of attribute error_info.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #has_error? ⇒ Boolean
-
#initialize(response) ⇒ Responser
constructor
A new instance of Responser.
- #result ⇒ Object
Methods included from Helpers::SessionResponse
Methods included from Helpers::KeepAliveResponse
Methods included from Helpers::InformationResponse
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_info ⇒ Object (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 |
#response ⇒ Object (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
24 25 26 |
# File 'lib/betfair_api_ng_rails/api/http/responser.rb', line 24 def has_error? http_error? end |
#result ⇒ Object
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 |