Class: Goz::Group::Base
- Inherits:
-
Object
- Object
- Goz::Group::Base
- Defined in:
- lib/goz/group/base.rb
Overview
Constant Summary collapse
- TAG =
self.name
- @@cf =
{}
Instance Attribute Summary collapse
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
-
.configuration(configuration) ⇒ Object
Set configuration.
-
.find_by_name(name) ⇒ Object
Find Goz::Group by name or return
nil
. -
.groups(user) ⇒ Object
Return groups where
user
is an admin. -
.memberships(user) ⇒ Object
Return groups where
user
is a member.
Instance Method Summary collapse
-
#[](key) ⇒ Object
TODO.
-
#admins ⇒ Object
TODO.
-
#members ⇒ Object
TODO.
-
#to_hash ⇒ Object
Convert to Goz::Group-style hash.
-
#to_s ⇒ Object
TODO.
Instance Attribute Details
#display_name ⇒ Object
Returns the value of attribute display_name.
29 30 31 |
# File 'lib/goz/group/base.rb', line 29 def display_name @display_name end |
#identifier ⇒ Object
Returns the value of attribute identifier.
29 30 31 |
# File 'lib/goz/group/base.rb', line 29 def identifier @identifier end |
#klass ⇒ Object
Returns the value of attribute klass.
29 30 31 |
# File 'lib/goz/group/base.rb', line 29 def klass @klass end |
#name ⇒ Object
Returns the value of attribute name.
29 30 31 |
# File 'lib/goz/group/base.rb', line 29 def name @name end |
Class Method Details
.configuration(configuration) ⇒ Object
Set configuration.
44 45 46 |
# File 'lib/goz/group/base.rb', line 44 def self.configuration(configuration) @@cf = configuration end |
.find_by_name(name) ⇒ Object
Find Goz::Group by name or return nil
MUST be implemented by API extensions.
53 54 55 |
# File 'lib/goz/group/base.rb', line 53 def self.find_by_name(name) raise RuntimeError, "not implemented" end |
.groups(user) ⇒ Object
Return groups where user
is an admin.
MUST be implemented by API extensions.
80 81 82 |
# File 'lib/goz/group/base.rb', line 80 def self.groups(user) raise RuntimeError, "not implemented" end |
.memberships(user) ⇒ Object
Return groups where user
is a member.
MUST be implemented by API extensions.
89 90 91 |
# File 'lib/goz/group/base.rb', line 89 def self.memberships(user) raise RuntimeError, "not implemented" end |
Instance Method Details
#[](key) ⇒ Object
TODO
37 38 39 |
# File 'lib/goz/group/base.rb', line 37 def [](key) send key.to_sym end |
#admins ⇒ Object
TODO
MUST be implemented by API extensions.
62 63 64 |
# File 'lib/goz/group/base.rb', line 62 def admins() raise RuntimeError, "not implemented" end |
#members ⇒ Object
TODO
MUST be implemented by API extensions.
71 72 73 |
# File 'lib/goz/group/base.rb', line 71 def members() raise RuntimeError, "not implemented" end |
#to_hash ⇒ Object
Convert to Goz::Group-style hash
96 97 98 99 100 101 102 |
# File 'lib/goz/group/base.rb', line 96 def to_hash return { :display_name => self.display_name, :identifier => self.identifier, :klass => self.klass, :name => self.name } end |
#to_s ⇒ Object
TODO
107 108 109 |
# File 'lib/goz/group/base.rb', line 107 def to_s "display_name=#{display_name} | identifier=#{identifier} | klass=#{klass} | name=#{name}" end |