Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/models/user.rb
Instance Attribute Summary collapse
-
#father_name ⇒ Object
readonly
Returns the value of attribute father_name.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(user_id, first_name, last_name, father_name = nil) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(user_id, first_name, last_name, father_name = nil) ⇒ User
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/models/user.rb', line 4 def initialize(user_id, first_name, last_name, father_name = nil) validate_null('user_id', user_id) validate_null('first_name', first_name) validate_null('last_name', last_name) validate_name_length(first_name, last_name, father_name) @user_id = user_id @first_name = first_name @last_name = last_name @father_name = father_name end |
Instance Attribute Details
#father_name ⇒ Object (readonly)
Returns the value of attribute father_name.
2 3 4 |
# File 'lib/models/user.rb', line 2 def father_name @father_name end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
2 3 4 |
# File 'lib/models/user.rb', line 2 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
2 3 4 |
# File 'lib/models/user.rb', line 2 def last_name @last_name end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
2 3 4 |
# File 'lib/models/user.rb', line 2 def user_id @user_id end |