Sha256: 7e1a82aa2da5f1acd071fef36376cedf84ee330233dfa60099182eee19eb2667

Contents?: true

Size: 881 Bytes

Versions: 56

Compression:

Stored size: 881 Bytes

Contents

module Sportradar
  module Api
    module Basketball
      class Record < Data
        attr_accessor :id, :team, :wins, :losses, :win_pct, :points_for, :points_against, :point_diff, :games_behind, :streak

        def initialize(data, type: 'overall', **opts)
          @team     = opts[:team]
          @type     = type

          update(data, **opts)
        end

        def profile
          Profile.new(self)
        end

        def update(data, **opts)
          @wins           = data['wins'].to_i
          @losses         = data['losses'].to_i
          @win_pct        = data['win_pct'].to_f
          @points_for     = data['points_for']
          @points_against = data['points_against']
          @point_diff     = data['point_diff']
          @games_behind   = data['games_behind']
          @streak         = data['streak']
        end

      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
sportradar-api-0.10.55 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.54 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.53 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.52 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.51 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.50 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.49 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.48 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.47 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.46 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.45 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.44 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.43 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.42 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.41 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.40 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.39 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.38 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.37 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.36 lib/sportradar/api/basketball/record.rb