Sha256: e8c2dde7f594a87dcc838d18a11a87c6e8436c813d9585e25486426502fe2f60
Contents?: true
Size: 576 Bytes
Versions: 9
Compression:
Stored size: 576 Bytes
Contents
# frozen_string_literal: true module Basketball module Org # Base class describing a player. # A consumer application should extend these specific to their specific sports traits. class Player < Entity attr_reader :overall, :position def initialize(id:, overall: 0, position: nil) super(id) raise ArgumentError, 'position is required' unless position @overall = overall @position = position freeze end def to_s "[#{super}] (#{position}) #{overall}".strip end end end end
Version data entries
9 entries across 9 versions & 1 rubygems