Class: LSports::Client
- 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
-
#guid ⇒ Object
Returns the value of attribute guid.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(username:, password:, guid:) ⇒ Client
constructor
A new instance of Client.
- #params ⇒ Object
- #query_params(query) ⇒ Object
- #request_url(path) ⇒ Object
Methods included from Api::Prematch
#events, #fixture_markets, #fixtures
Methods included from Api::Reference
#bookmakers, #leagues, #locations, #markets, #sports
Methods inherited from Request
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
#guid ⇒ Object
Returns the value of attribute guid.
6 7 8 |
# File 'lib/lsports/client.rb', line 6 def guid @guid end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/lsports/client.rb', line 6 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/lsports/client.rb', line 6 def username @username end |
Instance Method Details
#params ⇒ Object
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 |