Class: Goz::Group::Base

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

Overview

Goz::Group::Base - TODO

Usage

TODO

Author

blair christensen. <[email protected]>

Homepage

github.com/blairc/goz/

Direct Known Subclasses

EtcGroup, Grouper

Constant Summary collapse

TAG =
self.name
@@cf =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#display_nameObject

Returns the value of attribute display_name.



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

def display_name
  @display_name
end

#identifierObject

Returns the value of attribute identifier.



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

def identifier
  @identifier
end

#klassObject

Returns the value of attribute klass.



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

def klass
  @klass
end

#nameObject

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.

Raises:

  • (RuntimeError)


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.

Raises:

  • (RuntimeError)


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.

Raises:

  • (RuntimeError)


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

#adminsObject

TODO

MUST be implemented by API extensions.

Raises:

  • (RuntimeError)


62
63
64
# File 'lib/goz/group/base.rb', line 62

def admins()
  raise RuntimeError, "not implemented"
end

#membersObject

TODO

MUST be implemented by API extensions.

Raises:

  • (RuntimeError)


71
72
73
# File 'lib/goz/group/base.rb', line 71

def members()
  raise RuntimeError, "not implemented"
end

#to_hashObject

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_sObject

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