def where(input, property, target_value = nil)
      ary = InputIterator.new(input)

      if ary.empty?
        []
      elsif ary.first.respond_to?(:[]) && target_value.nil?
        begin
          ary.select { |item| item[property] }
        rescue TypeError
          raise_property_error(property)
        end
      elsif ary.first.respond_to?(:[])
        begin
          ary.select { |item| item[property] == target_value }
        rescue TypeError
          raise_property_error(property)
        end
      end
    end
def where(input, property, target_value = nil)
      ary = InputIterator.new(input)

      if ary.empty?
        []
      elsif ary.first.respond_to?(:[]) && target_value.nil?
        begin
          ary.select { |item| item[property] }
        rescue TypeError
          raise_property_error(property)
        end
      elsif ary.first.respond_to?(:[])
        begin
          ary.select { |item| item[property] == target_value }
        rescue TypeError
          raise_property_error(property)
        end
      end
    end
Filter the elements of an array to those with a certain property value.
 By default the target is any truthy value.