Class: GameCodebreaker::User
- Inherits:
-
Object
- Object
- GameCodebreaker::User
- Defined in:
- lib/game_codebreaker/user.rb
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#games ⇒ Object
Returns the value of attribute games.
-
#name ⇒ Object
Returns the value of attribute name.
-
#surname ⇒ Object
Returns the value of attribute surname.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(name, surname, age, games = []) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(name, surname, age, games = []) ⇒ User
Returns a new instance of User.
6 7 8 |
# File 'lib/game_codebreaker/user.rb', line 6 def initialize( name, surname, age, games=[] ) @name, @surname, @age, @games = name, surname, age, games end |
Instance Attribute Details
#age ⇒ Object
Returns the value of attribute age.
4 5 6 |
# File 'lib/game_codebreaker/user.rb', line 4 def age @age end |
#games ⇒ Object
Returns the value of attribute games.
4 5 6 |
# File 'lib/game_codebreaker/user.rb', line 4 def games @games end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/game_codebreaker/user.rb', line 4 def name @name end |
#surname ⇒ Object
Returns the value of attribute surname.
4 5 6 |
# File 'lib/game_codebreaker/user.rb', line 4 def surname @surname end |
Instance Method Details
#hash ⇒ Object
10 11 12 |
# File 'lib/game_codebreaker/user.rb', line 10 def hash [@name, @surname].hash end |