Sha256: d6017d9f171139f37b76d58761646589bf31b5f552b79ac210c4efbc2b96e6fc

Contents?: true

Size: 687 Bytes

Versions: 3

Compression:

Stored size: 687 Bytes

Contents

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


        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

3 entries across 3 versions & 1 rubygems

Version Path
sportradar-api-0.17.6 lib/sportradar/api/odds/market.rb
sportradar-api-0.17.5 lib/sportradar/api/odds/market.rb
sportradar-api-0.17.5.pre lib/sportradar/api/odds/market.rb