Class: Ddr::Auth::Affiliation Abstract
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Ddr::Auth::Affiliation
- Defined in:
- lib/ddr/auth/affiliation.rb
Overview
This class is abstract.
Constant Summary collapse
- VALUES =
[:faculty, :staff, :student, :emeritus, :affiliate, :alumni]
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.all ⇒ Object
23 24 25 |
# File 'lib/ddr/auth/affiliation.rb', line 23 def all @all ||= VALUES.map { |value| get(value) } end |
.get(affiliation) ⇒ Object
27 28 29 |
# File 'lib/ddr/auth/affiliation.rb', line 27 def get(affiliation) const_get(affiliation.to_s.capitalize) end |
.group(affiliation) ⇒ Object
31 32 33 |
# File 'lib/ddr/auth/affiliation.rb', line 31 def group(affiliation) get(affiliation).group end |
.groups ⇒ Object
35 36 37 |
# File 'lib/ddr/auth/affiliation.rb', line 35 def groups @groups ||= all.map(&:group) end |