Sha256: 566f80e162222419869791a91d3bd9f589e640fb371db6b3d9e70d823e24df8e
Contents?: true
Size: 704 Bytes
Versions: 7
Compression:
Stored size: 704 Bytes
Contents
module JustGo # = PlayerStat # # Place to store a players statistics class PlayerStat def initialize(player_number: , prisoner_count: 0, passed: false) @player_number = player_number @prisoner_count = prisoner_count @passed = passed end attr_reader :player_number attr_reader :prisoner_count attr_reader :passed def as_json { player_number: player_number, prisoner_count: prisoner_count, passed: passed } end def mark_as_passed @passed = true end def mark_as_continuing @passed = false end def add_to_prisoner_count(number) @prisoner_count += number end end end
Version data entries
7 entries across 7 versions & 1 rubygems