Class: User

Inherits:
Object
  • Object
show all
Defined in:
lib/slimtimercli/entities.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(e = nil, p = nil) ⇒ User

Returns a new instance of User.



55
56
57
58
# File 'lib/slimtimercli/entities.rb', line 55

def initialize(e=nil, p=nil)
  @email = e
  @password = p
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



53
54
55
# File 'lib/slimtimercli/entities.rb', line 53

def email
  @email
end

#nameObject

Returns the value of attribute name.



53
54
55
# File 'lib/slimtimercli/entities.rb', line 53

def name
  @name
end

#passwordObject

Returns the value of attribute password.



53
54
55
# File 'lib/slimtimercli/entities.rb', line 53

def password
  @password
end

#user_idObject

Returns the value of attribute user_id.



53
54
55
# File 'lib/slimtimercli/entities.rb', line 53

def user_id
  @user_id
end

Class Method Details

._load(hsh) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/slimtimercli/entities.rb', line 60

def self._load(hsh)
  u = User.new
  hsh.each do |k,v|
    u.send("#{k}=".to_sym, v) if u.respond_to?("#{k}=".to_sym)
  end
  u
end

Instance Method Details

#_serializeObject



68
69
70
# File 'lib/slimtimercli/entities.rb', line 68

def _serialize
  {"user" => {"email" => email, "password" => password}}
end