# frozen_string_literal: true require_relative 'user' module LeapSalesforce # Where test users are defined module Users @list = [] class << self # @return [Array] List of test users attr_reader :list # @param [LeapSalesforce::User] def add(user) @list << user end # Return a user that meets the criteria def where(filter) lookup_key, lookup_value = filter.first @list.find { |user| user.send(lookup_key) == lookup_value } end end end end