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.35 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.34 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.33 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.32 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.31 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.30 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.29 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.28 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.27 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.26 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.25 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.24 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.23 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.22 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.21 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.20 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.19 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.18 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.17 lib/sportradar/api/basketball/record.rb
sportradar-api-0.10.16 lib/sportradar/api/basketball/record.rb