Sha256: 6d1e24c63df66aa7dd211d850908fe85fcdc67a6d58f1cb6048a5cbf482799ea

Contents?: true

Size: 1.49 KB

Versions: 17

Compression:

Stored size: 1.49 KB

Contents

module Sportradar
  module Api
    module Odds
      class Outcome < Data
        attr_accessor :response, :id
        attr_accessor :type, :odds_decimal, :odds_american, :odds_fraction, :open_odds_decimal, :open_odds_american, :open_odds_fraction, :total, :open_total, :external_outcome_id, :removed


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

          @id       = data['id']

          update(data, **opts)
        end

        def update(data, **opts)
          @type                 = data['type']                  if data['type']
          @odds_decimal         = data['odds_decimal']          if data['odds_decimal']
          @odds_american        = data['odds_american']         if data['odds_american']
          @odds_fraction        = data['odds_fraction']         if data['odds_fraction']
          @open_odds_decimal    = data['open_odds_decimal']     if data['open_odds_decimal']
          @open_odds_american   = data['open_odds_american']    if data['open_odds_american']
          @open_odds_fraction   = data['open_odds_fraction']    if data['open_odds_fraction']
          @total                = data['total']                 if data['total']
          @open_total           = data['open_total']            if data['open_total']
          @external_outcome_id  = data['external_outcome_id']   if data['external_outcome_id']
          @removed              = data['removed']               if data['removed']
        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/outcome.rb
sportradar-api-0.20.1 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.20.0 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.20.0.pre2 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.20.0.pre lib/sportradar/api/odds/outcome.rb
sportradar-api-0.19.6 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.19.5 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.19.4 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.19.3 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.19.2 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.19.1 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.19.0 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.18.1 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.18.0 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.17.6 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.17.5 lib/sportradar/api/odds/outcome.rb
sportradar-api-0.17.5.pre lib/sportradar/api/odds/outcome.rb