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.

See Also:

Constant Summary collapse

DEFAULT_NAME_PREFIX =
'group/'

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/models/hyrax/group_behavior.rb', line 33

def ==(other)
  other.class == self.class && other.name == name
end

#agent_keyString

Returns a local identifier for this group; for use (e.g.) in ACL data.

Returns:

  • (String)

    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_agentObject



44
45
46
# File 'app/models/hyrax/group_behavior.rb', line 44

def to_sipity_agent
  sipity_agent || create_sipity_agent!
end