Class: TroleGroups::Operations

Inherits:
Object
  • Object
show all
Includes:
Enumerable, Read, Write
Defined in:
lib/trole_groups/operations.rb,
lib/trole_groups/operations/read.rb,
lib/trole_groups/operations/write.rb

Overview

< Troles::Common::Operations

Defined Under Namespace

Modules: Read, Write

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Write

#+, #-, #==, #clear

Methods included from Read

#has?, #list, #roles, #roles_for, #used

Constructor Details

#initialize(rolegroup_subject) ⇒ Operations

constructor

Parameters:

  • the (Object)

    role subject, fx a User or UserAccount



15
16
17
# File 'lib/trole_groups/operations.rb', line 15

def initialize rolegroup_subject
  @rolegroup_subject = rolegroup_subject
end

Instance Attribute Details

#rolegroup_subjectObject (readonly)

Returns the value of attribute rolegroup_subject.



11
12
13
# File 'lib/trole_groups/operations.rb', line 11

def rolegroup_subject
  @rolegroup_subject
end

Instance Method Details

#eachObject

required method to act as enumerable iterates and yields all roles in the role list (Symbols)



21
22
23
# File 'lib/trole_groups/operations.rb', line 21

def each
  list.each { |rolegroup| yield rolegroup }
end