class User
Attributes
current_password[RW]
date_of_birth[RW]
email[RW]
first_name[RW]
image_url[RW]
last_name[RW]
new_password[RW]
password[RW]
Public Class Methods
get_payload(userWithClientInfo)
click to toggle source
# File lib/domain/user.rb, line 48 def self.get_payload(userWithClientInfo) return userWithClientInfo.to_json end
json_create(o)
click to toggle source
# 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
new(first_name: nil, last_name: nil, password: nil, date_of_birth:nil, email: nil, image_url: nil)
click to toggle source
# 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
Public Instance Methods
to_json(*a)
click to toggle source
# 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