Class: Ddr::Auth::Group

Inherits:
Agent
  • Object
show all
Defined in:
lib/ddr/auth/group.rb

Instance Method Summary collapse

Methods inherited from Agent

#==, #agent_name, agent_type, #agent_type, build, #inspect, #to_h, #to_s

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object

Override for backward-compatibility with String-based groups



15
16
17
18
19
20
21
# File 'lib/ddr/auth/group.rb', line 15

def method_missing(meth, *args)
  if to_s.respond_to?(meth)
    to_s.send(meth, *args)
  else
    super
  end
end

Instance Method Details

#has_member?(user) ⇒ Boolean

The inverse of ‘Ddr::Auth::User#member_of?(group)`

Returns:

  • (Boolean)


10
11
12
# File 'lib/ddr/auth/group.rb', line 10

def has_member?(user)
  user.groups.include?(self)
end