Class: NBA::Client
- Inherits:
-
Object
- Object
- NBA::Client
- Defined in:
- lib/nba/client.rb
Overview
API client for making requests to the NBA Stats API
Instance Attribute Summary collapse
-
#connection ⇒ Connection
readonly
private
Returns the connection used for HTTP requests.
Instance Method Summary collapse
-
#get(path) ⇒ String
Makes a GET request to the specified path.
-
#initialize(connection: Connection.new) ⇒ NBA::Client
constructor
Initializes a new Client object.
Constructor Details
#initialize(connection: Connection.new) ⇒ NBA::Client
Initializes a new Client object
28 29 30 |
# File 'lib/nba/client.rb', line 28 def initialize(connection: Connection.new) @connection = connection end |
Instance Attribute Details
#connection ⇒ Connection (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the connection used for HTTP requests
19 20 21 |
# File 'lib/nba/client.rb', line 19 def connection @connection end |
Instance Method Details
#get(path) ⇒ String
Makes a GET request to the specified path
13 |
# File 'lib/nba/client.rb', line 13 def get(path) = connection.get(path) |