Sha256: 5136af015cdd58074ab3c8342a9b8eac26cc43027db70825d1c83c420c0a62b6

Contents?: true

Size: 696 Bytes

Versions: 14

Compression:

Stored size: 696 Bytes

Contents

module Sportradar
  module Api
    module Odds
      class Market < Data
        attr_accessor :response, :id, :name, :player


        def initialize(data, **opts)
          @response = data
          @api      = opts[:api]

          @id       = data['id']
          @name     = data['name']
          @player   = opts['player']

          @book_markets_hash = {}

          update(data, **opts)
        end

        def book_markets
          @book_markets_hash.values
        end

        def update(data, **opts)
          create_data(@book_markets_hash, data['books'], klass: BookMarket, api: @api, market: self, player: @player) if data['books']
        end

      end
    end
  end
end


Version data entries

14 entries across 14 versions & 1 rubygems

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