Class: Inspec::Resources::UserGroups

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

Overview

Class defined to compare for groups without case-sensitivity

Instance Method Summary collapse

Constructor Details

#initialize(user_groups) ⇒ UserGroups

Returns a new instance of UserGroups.



390
391
392
393
# File 'lib/inspec/resources/users.rb', line 390

def initialize(user_groups)
  @user_groups = user_groups
  super
end

Instance Method Details

#include?(group) ⇒ Boolean

Returns:

  • (Boolean)


395
396
397
# File 'lib/inspec/resources/users.rb', line 395

def include?(group)
  !(@user_groups.select { |user_group| user_group.casecmp?(group) }.empty?)
end