Sha256: 3c4dd8b28fb5f06f984d6cc051334be6be2383101cdd261da2f6778c620e8783

Contents?: true

Size: 677 Bytes

Versions: 106

Compression:

Stored size: 677 Bytes

Contents

module Sportradar
  module Api
    module Football
      class StatPack < Data
        attr_accessor :response, :player, :name, :id, :position, :yards, :players

        def initialize(data)
          @response = data || {}
          @player = Sportradar::Api::Nfl::Player.new(response) if response['name'] # this isn't used yet, and we need to determine a better solution
          @players = parse_into_array(selector: response["player"], klass: self.class) if response["player"]
          set_stats
        end

        private

        def set_stats
          raise NotImplementedError, "Please implement `#{self.class}#set_stats`"
        end

      end
    end
  end
end

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
sportradar-api-0.10.35 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.34 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.33 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.32 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.31 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.30 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.29 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.28 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.27 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.26 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.25 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.24 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.23 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.22 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.21 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.20 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.19 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.18 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.17 lib/sportradar/api/football/stat_pack.rb
sportradar-api-0.10.16 lib/sportradar/api/football/stat_pack.rb