Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/random_check_question/14.rb,
lib/random_check_question/15.rb
Instance Attribute Summary collapse
-
#age ⇒ Object
readonly
Returns the value of attribute age.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
Instance Method Summary collapse
-
#initialize(name) ⇒ User
constructor
A new instance of User.
- #name ⇒ Object
Constructor Details
#initialize(name) ⇒ User
Returns a new instance of User.
5 6 7 8 9 |
# File 'lib/random_check_question/14.rb', line 5 def initialize(first_name, last_name, age) @first_name = first_name @last_name = last_name @age = age end |
Instance Attribute Details
#age ⇒ Object (readonly)
Returns the value of attribute age.
3 4 5 |
# File 'lib/random_check_question/14.rb', line 3 def age @age end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/random_check_question/14.rb', line 3 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/random_check_question/14.rb', line 3 def last_name @last_name end |
Instance Method Details
#name ⇒ Object
6 7 8 |
# File 'lib/random_check_question/15.rb', line 6 def name @name end |