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