Class: Betfair::Client

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/betfair/client.rb

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

Instance Method Summary collapse

Methods included from Utils

#attempt

Constructor Details

#initialize(headers = {}, api_type = :rest, settings = {}) ⇒ Client

Returns a new instance of Client.



22
23
24
25
26
27
# File 'lib/betfair/client.rb', line 22

def initialize(headers = {}, api_type = :rest, settings = {})
  @settings = DEFAULT_SETTINGS.merge(settings)
  @persistent_headers = {}
  @persistent_headers.merge!(headers)
  extend_api(api_type)
end

Instance Attribute Details

#persistent_headersObject

Returns the value of attribute persistent_headers.



20
21
22
# File 'lib/betfair/client.rb', line 20

def persistent_headers
  @persistent_headers
end

#settingsObject

Returns the value of attribute settings.



20
21
22
# File 'lib/betfair/client.rb', line 20

def settings
  @settings
end