Class: AuthLh::User
- Inherits:
-
Object
- Object
- AuthLh::User
- Defined in:
- lib/auth_lh/user.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#email ⇒ Object
Returns the value of attribute email.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#jabber ⇒ Object
Returns the value of attribute jabber.
-
#login ⇒ Object
Returns the value of attribute login.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password_expired ⇒ Object
Returns the value of attribute password_expired.
-
#role_codes ⇒ Object
Returns the value of attribute role_codes.
-
#shop_code ⇒ Object
Returns the value of attribute shop_code.
Instance Method Summary collapse
- #has_role?(role_code) ⇒ Boolean
-
#initialize(attributes = {}) ⇒ User
constructor
A new instance of User.
- #password_expired? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ User
Returns a new instance of User.
6 7 8 9 10 |
# File 'lib/auth_lh/user.rb', line 6 def initialize(attributes={}) attributes.each do |k,v| self.send("#{k}=", v) end end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def code @code end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def email @email end |
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def enabled @enabled end |
#jabber ⇒ Object
Returns the value of attribute jabber.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def jabber @jabber end |
#login ⇒ Object
Returns the value of attribute login.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def login @login end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def name @name end |
#password_expired ⇒ Object
Returns the value of attribute password_expired.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def password_expired @password_expired end |
#role_codes ⇒ Object
Returns the value of attribute role_codes.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def role_codes @role_codes end |
#shop_code ⇒ Object
Returns the value of attribute shop_code.
3 4 5 |
# File 'lib/auth_lh/user.rb', line 3 def shop_code @shop_code end |
Instance Method Details
#has_role?(role_code) ⇒ Boolean
16 17 18 |
# File 'lib/auth_lh/user.rb', line 16 def has_role?(role_code) role_codes.include?(role_code.to_s) end |
#password_expired? ⇒ Boolean
12 13 14 |
# File 'lib/auth_lh/user.rb', line 12 def password_expired? password_expired == true end |