Class: Goz::User::Base
- Inherits:
-
Object
- Object
- Goz::User::Base
- Defined in:
- lib/goz/user/base.rb
Overview
Constant Summary collapse
- TAG =
self.name
- @@cf =
{}
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#login ⇒ Object
Returns the value of attribute login.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
-
.configuration(configuration) ⇒ Object
Set configuration.
-
.find_by_login(login) ⇒ Object
Find Goz::User by login or return
nil
.
Instance Method Summary collapse
-
#[](key) ⇒ Object
TODO.
-
#to_hash ⇒ Object
Convert to Goz::User-style hash.
-
#to_s ⇒ Object
TODO.
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
29 30 31 |
# File 'lib/goz/user/base.rb', line 29 def email @email end |
#identifier ⇒ Object
Returns the value of attribute identifier.
29 30 31 |
# File 'lib/goz/user/base.rb', line 29 def identifier @identifier end |
#klass ⇒ Object
Returns the value of attribute klass.
29 30 31 |
# File 'lib/goz/user/base.rb', line 29 def klass @klass end |
#login ⇒ Object
Returns the value of attribute login.
29 30 31 |
# File 'lib/goz/user/base.rb', line 29 def login @login end |
#name ⇒ Object
Returns the value of attribute name.
29 30 31 |
# File 'lib/goz/user/base.rb', line 29 def name @name end |
Class Method Details
.configuration(configuration) ⇒ Object
Set configuration.
44 45 46 |
# File 'lib/goz/user/base.rb', line 44 def self.configuration(configuration) @@cf = configuration end |
.find_by_login(login) ⇒ Object
Find Goz::User by login or return nil
.
MUST be implemented by API extensions.
53 54 55 |
# File 'lib/goz/user/base.rb', line 53 def self.find_by_login(login) raise RuntimeError, "not implemented" end |
Instance Method Details
#[](key) ⇒ Object
TODO
37 38 39 |
# File 'lib/goz/user/base.rb', line 37 def [](key) send key.to_sym end |
#to_hash ⇒ Object
Convert to Goz::User-style hash
60 61 62 63 64 65 66 67 |
# File 'lib/goz/user/base.rb', line 60 def to_hash return { :email => self.email, :identifier => self.identifier, :klass => self.klass, :login => self.login, :name => self.name } end |
#to_s ⇒ Object
TODO
72 73 74 |
# File 'lib/goz/user/base.rb', line 72 def to_s "email=#{email} | identifier=#{identifier} | klass=#{klass} | login=#{login} | name=#{name}" end |