Class: NflData::Api::Schedule
- Inherits:
-
Object
- Object
- NflData::Api::Schedule
- Defined in:
- lib/nfl_data/api/schedule.rb
Instance Attribute Summary collapse
-
#feed ⇒ Object
readonly
Returns the value of attribute feed.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(parser: Parsers::ScheduleParser.new, feed: MySportsFeeds::SeasonalGamesFeed.new) ⇒ Schedule
constructor
A new instance of Schedule.
- #season(year:) ⇒ Object
Constructor Details
#initialize(parser: Parsers::ScheduleParser.new, feed: MySportsFeeds::SeasonalGamesFeed.new) ⇒ Schedule
8 9 10 11 |
# File 'lib/nfl_data/api/schedule.rb', line 8 def initialize(parser: Parsers::ScheduleParser.new, feed: MySportsFeeds::SeasonalGamesFeed.new) @parser = parser @feed = feed end |
Instance Attribute Details
#feed ⇒ Object (readonly)
Returns the value of attribute feed.
6 7 8 |
# File 'lib/nfl_data/api/schedule.rb', line 6 def feed @feed end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
6 7 8 |
# File 'lib/nfl_data/api/schedule.rb', line 6 def parser @parser end |
Instance Method Details
#season(year:) ⇒ Object
13 14 15 16 |
# File 'lib/nfl_data/api/schedule.rb', line 13 def season(year:) schedule_data = feed.feed(season_start_year: year) parser.parse(schedule_data: schedule_data).to_h.to_json end |