Class: Betfair::Client
Constant Summary collapse
- DEFAULT_SETTINGS =
{ retries: 1 }
- OPERATIONS =
{ betting: [:list_event_types, :list_events, :list_market_catalogue, :list_market_book, :list_competitions, :list_market_profit_and_loss, :list_countries, :list_current_orders, :list_cleared_orders, :list_market_types, :list_time_ranges, :list_venues, :place_orders, :cancel_orders, :replace_orders, :update_orders], account: [:get_account_funds] }
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#persistent_headers ⇒ Object
Returns the value of attribute persistent_headers.
-
#request_opts ⇒ Object
Returns the value of attribute request_opts.
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
-
#initialize(headers = {}, opts = {}, api_type = :rest) ⇒ Client
constructor
A new instance of Client.
Methods included from Utils
Constructor Details
#initialize(headers = {}, opts = {}, api_type = :rest) ⇒ Client
Returns a new instance of Client.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/betfair/client.rb', line 23 def initialize(headers = {}, opts = {}, api_type = :rest) set_endpoint!(opts.delete(:endpoint)) setting_opts = opts.extract!(:retries, :adapter) @settings = DEFAULT_SETTINGS.merge(setting_opts) @persistent_headers = headers @request_opts = opts extend_api(api_type) end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
21 22 23 |
# File 'lib/betfair/client.rb', line 21 def endpoint @endpoint end |
#persistent_headers ⇒ Object
Returns the value of attribute persistent_headers.
21 22 23 |
# File 'lib/betfair/client.rb', line 21 def persistent_headers @persistent_headers end |
#request_opts ⇒ Object
Returns the value of attribute request_opts.
21 22 23 |
# File 'lib/betfair/client.rb', line 21 def request_opts @request_opts end |
#settings ⇒ Object
Returns the value of attribute settings.
21 22 23 |
# File 'lib/betfair/client.rb', line 21 def settings @settings end |