Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/domain/user.rb
Instance Attribute Summary collapse
-
#current_password ⇒ Object
Returns the value of attribute current_password.
-
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#new_password ⇒ Object
Returns the value of attribute new_password.
-
#password ⇒ Object
Returns the value of attribute password.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(first_name: nil, last_name: nil, password: nil, date_of_birth: nil, email: nil, image_url: nil) ⇒ User
constructor
A new instance of User.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(first_name: nil, last_name: nil, password: nil, date_of_birth: nil, email: nil, image_url: nil) ⇒ User
Returns a new instance of User.
13 14 15 16 |
# File 'lib/domain/user.rb', line 13 def initialize first_name: nil, last_name: nil, password: nil, date_of_birth:nil, email: nil, image_url: nil self.first_name, self.last_name, self.password, self.current_password, self.new_password, self.date_of_birth, self.email, self.image_url = first_name, last_name, password,current_password, new_password, date_of_birth, email, image_url end |
Instance Attribute Details
#current_password ⇒ Object
Returns the value of attribute current_password.
7 8 9 |
# File 'lib/domain/user.rb', line 7 def current_password @current_password end |
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
9 10 11 |
# File 'lib/domain/user.rb', line 9 def date_of_birth @date_of_birth end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/domain/user.rb', line 10 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/domain/user.rb', line 4 def first_name @first_name end |
#image_url ⇒ Object
Returns the value of attribute image_url.
11 12 13 |
# File 'lib/domain/user.rb', line 11 def image_url @image_url end |
#last_name ⇒ Object
Returns the value of attribute last_name.
5 6 7 |
# File 'lib/domain/user.rb', line 5 def last_name @last_name end |
#new_password ⇒ Object
Returns the value of attribute new_password.
8 9 10 |
# File 'lib/domain/user.rb', line 8 def new_password @new_password end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/domain/user.rb', line 6 def password @password end |
Class Method Details
.get_payload(userWithClientInfo) ⇒ Object
48 49 50 |
# File 'lib/domain/user.rb', line 48 def self.get_payload(userWithClientInfo) return userWithClientInfo.to_json end |
.json_create(o) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/domain/user.rb', line 35 def self.json_create(o) b_from_json = new b_from_json.first_name = o['first_name'] b_from_json.last_name = o['last_name'] b_from_json.password = o['password'] b_from_json.current_password = o['current_password'] b_from_json.new_password = o['new_password'] b_from_json.date_of_birth = o['date_of_birth'] b_from_json.email = o['email'] b_from_json.image_url = o['image_url'] b_from_json end |
Instance Method Details
#to_json(*a) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/domain/user.rb', line 20 def to_json(*a) hash = { first_name: @first_name, last_name: @last_name, password: @password, current_password: @current_password, new_password: @new_password, date_of_birth: @date_of_birth, email: @email, image_url: @image_url } hash.delete_if { |k, v| v.nil? } hash.to_json(*a) end |