Class: Stattr::CharacterSheet
- Inherits:
-
Object
- Object
- Stattr::CharacterSheet
- Defined in:
- lib/stattr.rb
Overview
CharacterSheet of a given PlayerCharacter.
Instance Attribute Summary collapse
-
#name ⇒ Object
The Player Character’s name.
-
#stats ⇒ Object
Returns the value of attribute stats.
Class Method Summary collapse
-
.roll_char(name) ⇒ Object
This is how you roll a brand new random character.
Instance Method Summary collapse
-
#initialize(name) ⇒ CharacterSheet
constructor
new instance of CharacterSheet.
Constructor Details
#initialize(name) ⇒ CharacterSheet
new instance of CharacterSheet
158 159 160 161 |
# File 'lib/stattr.rb', line 158 def initialize(name) @name = name @stats = StatList.new end |
Instance Attribute Details
#name ⇒ Object
The Player Character’s name
153 |
# File 'lib/stattr.rb', line 153 attr_accessor :stats, :name |
#stats ⇒ Object
Returns the value of attribute stats.
153 154 155 |
# File 'lib/stattr.rb', line 153 def stats @stats end |
Class Method Details
.roll_char(name) ⇒ Object
This is how you roll a brand new random character.
168 169 170 171 172 |
# File 'lib/stattr.rb', line 168 def self.roll_char(name) char = CharacterSheet.new(name) char.stats = StatList.new char end |