Class: Goz::User::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/goz/user/base.rb

Overview

Goz::User::Base - TODO

Usage

TODO

Author

blair christensen. <[email protected]>

Homepage

github.com/blairc/goz/

Direct Known Subclasses

EtcPasswd, LDAP

Constant Summary collapse

TAG =
self.name
@@cf =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emailObject

Returns the value of attribute email.



29
30
31
# File 'lib/goz/user/base.rb', line 29

def email
  @email
end

#identifierObject

Returns the value of attribute identifier.



29
30
31
# File 'lib/goz/user/base.rb', line 29

def identifier
  @identifier
end

#klassObject

Returns the value of attribute klass.



29
30
31
# File 'lib/goz/user/base.rb', line 29

def klass
  @klass
end

#loginObject

Returns the value of attribute login.



29
30
31
# File 'lib/goz/user/base.rb', line 29

def 
  @login
end

#nameObject

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.

Raises:

  • (RuntimeError)


53
54
55
# File 'lib/goz/user/base.rb', line 53

def self.()
  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_hashObject

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.,
           :name       => self.name
         }
end

#to_sObject

TODO



72
73
74
# File 'lib/goz/user/base.rb', line 72

def to_s
  "email=#{email} | identifier=#{identifier} | klass=#{klass} | login=#{} | name=#{name}"
end