Class: Inspec::Resources::Members

Inherits:
Array
  • Object
show all
Defined in:
lib/inspec/resources/groups.rb

Overview

Class defined to check for members without case-sensitivity

Instance Method Summary collapse

Constructor Details

#initialize(group_members) ⇒ Members

Returns a new instance of Members.



27
28
29
30
# File 'lib/inspec/resources/groups.rb', line 27

def initialize(group_members)
  @group_members = group_members
  super
end

Instance Method Details

#include?(user) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/inspec/resources/groups.rb', line 32

def include?(user)
  !(@group_members.select { |group_member| group_member.casecmp?(user) }.empty?)
end