Sha256: c1e3bd78467229dbe0ddb978fc49517557079d86087f4a49187043d4219c658e
Contents?: true
Size: 581 Bytes
Versions: 14
Compression:
Stored size: 581 Bytes
Contents
module SportsDataApi module Nfl class PlayByPlays include Enumerable attr_reader :events def initialize(pbp_events) @events = pbp_events.map do |pbp_event| if pbp_event["type"] == "event" Event.new(pbp_event) elsif pbp_event["type"] == "drive" Drive.new(pbp_event) end end end def each &block @events.each do |event| if block_given? block.call event else yield event end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems