Class: Hyrax::Group
- Inherits:
-
Object
- Object
- Hyrax::Group
- Defined in:
- app/models/hyrax/group.rb
Constant Summary collapse
- DEFAULT_NAME_PREFIX =
'group/'
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#agent_key ⇒ String
A local identifier for this group; for use (e.g.) in ACL data.
-
#initialize(name) ⇒ Group
constructor
A new instance of Group.
- #to_sipity_agent ⇒ Object
Constructor Details
#initialize(name) ⇒ Group
Returns a new instance of Group.
16 17 18 |
# File 'app/models/hyrax/group.rb', line 16 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
20 21 22 |
# File 'app/models/hyrax/group.rb', line 20 def name @name end |
Class Method Details
.from_agent_key(key) ⇒ Hyrax::Group
12 13 14 |
# File 'app/models/hyrax/group.rb', line 12 def self.from_agent_key(key) new(key.delete_prefix(name_prefix)) end |
.name_prefix ⇒ Object
6 7 8 |
# File 'app/models/hyrax/group.rb', line 6 def self.name_prefix DEFAULT_NAME_PREFIX end |
Instance Method Details
#==(other) ⇒ Boolean
24 25 26 |
# File 'app/models/hyrax/group.rb', line 24 def ==(other) other.class == self.class && other.name == name end |
#agent_key ⇒ String
Returns a local identifier for this group; for use (e.g.) in ACL data.
31 32 33 |
# File 'app/models/hyrax/group.rb', line 31 def agent_key self.class.name_prefix + name end |
#to_sipity_agent ⇒ Object
35 36 37 |
# File 'app/models/hyrax/group.rb', line 35 def to_sipity_agent sipity_agent || create_sipity_agent! end |