Class: User

Inherits:
Object
  • Object
show all
Defined in:
lib/random_check_question/14.rb,
lib/random_check_question/15.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ageObject (readonly)

Returns the value of attribute age.



3
4
5
# File 'lib/random_check_question/14.rb', line 3

def age
  @age
end

#first_nameObject (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_nameObject (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

#nameObject



6
7
8
# File 'lib/random_check_question/15.rb', line 6

def name
  @name
end