Sha256: d802f073b16939a9849b431499aa22b38c4654eaa4c67d554402eb6b7fd86b7c

Contents?: true

Size: 616 Bytes

Versions: 17

Compression:

Stored size: 616 Bytes

Contents

module Sportradar
  module Api
    module Odds
      class Player < Data
        attr_accessor :response, :api, :id


        def initialize(data, **opts)
          @response = data
          @api      = opts[:api]
          @id       = data['id'] || data.dig('player', 'id')

          @props_hash = {}

          update(data['player'])  if data['player']
          update(data)
        end

        def update(data, **opts)
          # @name ||= data['name'] if data['name']

          create_data(@props_hash, data['markets'], klass: Player, api: api) if data['markets']
        end

      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sportradar-api-0.20.2 lib/sportradar/api/odds/player.rb
sportradar-api-0.20.1 lib/sportradar/api/odds/player.rb
sportradar-api-0.20.0 lib/sportradar/api/odds/player.rb
sportradar-api-0.20.0.pre2 lib/sportradar/api/odds/player.rb
sportradar-api-0.20.0.pre lib/sportradar/api/odds/player.rb
sportradar-api-0.19.6 lib/sportradar/api/odds/player.rb
sportradar-api-0.19.5 lib/sportradar/api/odds/player.rb
sportradar-api-0.19.4 lib/sportradar/api/odds/player.rb
sportradar-api-0.19.3 lib/sportradar/api/odds/player.rb
sportradar-api-0.19.2 lib/sportradar/api/odds/player.rb
sportradar-api-0.19.1 lib/sportradar/api/odds/player.rb
sportradar-api-0.19.0 lib/sportradar/api/odds/player.rb
sportradar-api-0.18.1 lib/sportradar/api/odds/player.rb
sportradar-api-0.18.0 lib/sportradar/api/odds/player.rb
sportradar-api-0.17.6 lib/sportradar/api/odds/player.rb
sportradar-api-0.17.5 lib/sportradar/api/odds/player.rb
sportradar-api-0.17.5.pre lib/sportradar/api/odds/player.rb