Sha256: 202fe9a0899ef61eb7867d3008657f3e52f7aa0da33d86235301e70ed090e598

Contents?: true

Size: 432 Bytes

Versions: 14

Compression:

Stored size: 432 Bytes

Contents

module SportsDataApi
  module Nfl
    class Actions
      class << self
        def build_actions(actions)
          actions.map do |action|
            map_by_type(action)
          end
        end

        def map_by_type(action)
          case action["type"]
          when "event"
            EventAction.new(action)
          when "play"
            PlayAction.new(action)
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sports_data_api-0.14.1 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.14.0 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.13.0 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.12.1 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.12.0 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.11.6 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.11.5 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.11.3 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.11.2 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.11.1 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.11.0 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.10.1 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.10.0 lib/sports_data_api/nfl/actions.rb
sports_data_api-0.9.2 lib/sports_data_api/nfl/actions.rb