Class AutomateIt::AccountManager::Etc::GroupQuery
In: lib/automateit/account_manager/etc.rb
Parent: Object

GroupQuery

A class used for querying groups. See AccountManager#groups.

Methods

[]  

Public Instance methods

See AccountManager#groups

[Source]

# File lib/automateit/account_manager/etc.rb, line 62
    def [](query)
      ::Etc.endgrent
      begin
        case query
        when String
          return ::Etc.getgrnam(query)
        when Fixnum
          return ::Etc.getgrgid(query)
        else
          raise TypeError.new("unknonwn type for query: #{query.class}")
        end
      rescue ArgumentError
        return nil
      end
    end

[Validate]