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