Sha256: 1cb34a2b2aa6b62410f5051c8083fb1680fe3f68b1637f540b797369e66bf9b6

Contents?: true

Size: 590 Bytes

Versions: 15

Compression:

Stored size: 590 Bytes

Contents

module Sportradar
  module Api
    module Football
      class Situation < Data
        attr_accessor :response, :clock, :down, :yfd, :possession, :location, :team_id

        def initialize(data)
          @response   = data
          @clock      = data["clock"]
          @down       = data["down"]
          @yfd        = data["yfd"]
          @possession = OpenStruct.new(data["possession"]) if data["possession"]
          @location   = OpenStruct.new(data["location"])   if data["location"]
          @team_id    = possession.id if possession
        end

      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sportradar-api-0.11.15 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.14 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.13 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.12 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.11 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.10 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.9 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.8 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.7 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.6 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.5 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.4 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.3 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.1 lib/sportradar/api/football/situation.rb
sportradar-api-0.11.0 lib/sportradar/api/football/situation.rb