Class: EspnFflApi::ApiClient
- Inherits:
-
Object
- Object
- EspnFflApi::ApiClient
- Defined in:
- lib/espn_ffl_api/api_client.rb
Instance Attribute Summary collapse
-
#league_id ⇒ Object
readonly
Returns the value of attribute league_id.
- #params ⇒ Object
- #views ⇒ Object
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(year) ⇒ ApiClient
constructor
A new instance of ApiClient.
Constructor Details
#initialize(year) ⇒ ApiClient
Returns a new instance of ApiClient.
8 9 10 11 |
# File 'lib/espn_ffl_api/api_client.rb', line 8 def initialize(year) @year = year @league_id = EspnFflApi.config.league_id end |
Instance Attribute Details
#league_id ⇒ Object (readonly)
Returns the value of attribute league_id.
5 6 7 |
# File 'lib/espn_ffl_api/api_client.rb', line 5 def league_id @league_id end |
#params ⇒ Object
17 18 19 |
# File 'lib/espn_ffl_api/api_client.rb', line 17 def params @params ||= [] end |
#views ⇒ Object
13 14 15 |
# File 'lib/espn_ffl_api/api_client.rb', line 13 def views @views ||= [] end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
5 6 7 |
# File 'lib/espn_ffl_api/api_client.rb', line 5 def year @year end |
Instance Method Details
#get ⇒ Object
21 22 23 24 25 |
# File 'lib/espn_ffl_api/api_client.rb', line 21 def get uri = build_uri(views: views, params: params) puts "HTTP GET: #{uri}" HTTParty.get(uri) end |