Module: Hyrax::GroupBehavior
- Extended by:
- ActiveSupport::Concern
- Included in:
- Group
- Defined in:
- app/models/hyrax/group_behavior.rb
Overview
An ActiveSupport::Concern module that contains the Group logic. It is extracted to a behavior because downstream Hyku has a Hyrax::Group that inherits from ApplicationRecord. In other words it eschews the plain old Ruby object (PORO). However, both Hyku and Hyrax’s Group both have notable amounts of duplicated logic.
Constant Summary collapse
- DEFAULT_NAME_PREFIX =
'group/'
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#agent_key ⇒ String
A local identifier for this group; for use (e.g.) in ACL data.
- #to_sipity_agent ⇒ Object
Instance Method Details
#==(other) ⇒ Boolean
33 34 35 |
# File 'app/models/hyrax/group_behavior.rb', line 33 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.
40 41 42 |
# File 'app/models/hyrax/group_behavior.rb', line 40 def agent_key self.class.name_prefix + name end |
#to_sipity_agent ⇒ Object
44 45 46 |
# File 'app/models/hyrax/group_behavior.rb', line 44 def to_sipity_agent sipity_agent || create_sipity_agent! end |