Class: LSports::Client

Inherits:
Request show all
Includes:
Api::Prematch, Api::Reference
Defined in:
lib/lsports/client.rb

Constant Summary collapse

BASE_URL =
'https://prematch.lsports.eu/OddService'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api::Prematch

#events, #fixture_markets, #fixtures

Methods included from Api::Reference

#bookmakers, #leagues, #locations, #markets, #sports

Methods inherited from Request

#get

Constructor Details

#initialize(username:, password:, guid:) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
# File 'lib/lsports/client.rb', line 11

def initialize(username:, password:, guid:)
  @username = username
  @password = password
  @guid = guid
end

Instance Attribute Details

#guidObject

Returns the value of attribute guid.



6
7
8
# File 'lib/lsports/client.rb', line 6

def guid
  @guid
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/lsports/client.rb', line 6

def password
  @password
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/lsports/client.rb', line 6

def username
  @username
end

Instance Method Details

#paramsObject



25
26
27
# File 'lib/lsports/client.rb', line 25

def params
  { username: username, password: password, guid: guid }
end

#query_params(query) ⇒ Object



21
22
23
# File 'lib/lsports/client.rb', line 21

def query_params(query)
  { params: params.merge(query) }
end

#request_url(path) ⇒ Object



17
18
19
# File 'lib/lsports/client.rb', line 17

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