Class: Arrthorizer::Group

Inherits:
Role
  • Object
show all
Defined in:
lib/arrthorizer/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Role

get, register, registry, #to_key

Constructor Details

#initialize(name) ⇒ Group

Returns a new instance of Group.



10
11
12
13
14
# File 'lib/arrthorizer/group.rb', line 10

def initialize(name)
  @name = name

  Role.register(self)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/arrthorizer/group.rb', line 8

def name
  @name
end

Instance Method Details

#applies_to_user?(user, _) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/arrthorizer/group.rb', line 16

def applies_to_user?(user, _)
  is_member?(user)
end