Class: RTS::Client

Inherits:
Request show all
Includes:
Api::LiveSportEventInformation, Api::StaticSportEventInformation
Defined in:
lib/rts/client.rb

Constant Summary collapse

BASE_URL =
'https://api-json.sandbox.rtsmunity.com:6220'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api::LiveSportEventInformation

#live_match_feed, #live_match_state, #live_match_statistics_feed, #live_match_statistics_state, #live_matches, #live_series, #live_series_feed, #live_series_state, #statistics_states

Methods included from Api::StaticSportEventInformation

#leagues, #market_close_times, #market_resolve_times, #market_selections, #market_states, #markets, #match_positions, #match_states, #matches, #players, #series, #series_states, #series_types, #sports, #teams, #tournament_tiers, #tournaments

Methods inherited from Request

#get

Constructor Details

#initialize(api_key:, client_certificate: nil, client_key: nil, client_certificate_path: nil, client_key_path: nil) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
17
18
# File 'lib/rts/client.rb', line 12

def initialize(api_key:, client_certificate: nil, client_key: nil,
  client_certificate_path: nil, client_key_path: nil)
  @api_key = api_key
  configure_client_certificate(client_certificate, client_certificate_path)
  configure_client_key(client_key, client_key_path)
  validate_openssl_configuration
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



7
8
9
# File 'lib/rts/client.rb', line 7

def api_key
  @api_key
end

#client_certificateObject

Returns the value of attribute client_certificate.



7
8
9
# File 'lib/rts/client.rb', line 7

def client_certificate
  @client_certificate
end

#client_certificate_pathObject

Returns the value of attribute client_certificate_path.



7
8
9
# File 'lib/rts/client.rb', line 7

def client_certificate_path
  @client_certificate_path
end

#client_keyObject

Returns the value of attribute client_key.



7
8
9
# File 'lib/rts/client.rb', line 7

def client_key
  @client_key
end

#client_key_pathObject

Returns the value of attribute client_key_path.



7
8
9
# File 'lib/rts/client.rb', line 7

def client_key_path
  @client_key_path
end

Instance Method Details

#headersObject



24
25
26
# File 'lib/rts/client.rb', line 24

def headers
  { "X-Api-Key": api_key }
end

#request_url(path) ⇒ Object



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

def request_url(path)
  "#{BASE_URL}/#{path}"
end