class NflData::Api::Statline
Attributes
feed[R]
parser[R]
Public Class Methods
new(parser: Parsers::StatlineParser.new, feed: MySportsFeeds::WeeklyPlayerGamelogs.new)
click to toggle source
# File lib/nfl_data/api/statline.rb, line 6 def initialize(parser: Parsers::StatlineParser.new, feed: MySportsFeeds::WeeklyPlayerGamelogs.new) @parser = parser @feed = feed end
Public Instance Methods
statlines(year:, week:)
click to toggle source
# File lib/nfl_data/api/statline.rb, line 11 def statlines(year:, week:) statline_data = feed.feed(season_start_year: year, week: week) {statlines: parser.parse(statline_data: statline_data).map(&:to_h)}.to_json end