Exception: ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Exceptions::ObjectIsNotEnumerator

Inherits:
Exception
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/can_have_step_aware_enumerables/exceptions.rb

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_with_kwargs(object:) ⇒ void

This method returns an undefined value.

Parameters:

  • object (Object)

    Can be any type.



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/exceptions.rb', line 34

def initialize_with_kwargs(object:)
  message = <<~TEXT
    Object of class `#{Utils::Class.display_name(object.class)}` is neither enumerator nor can be converted into it by calling `#each` without block.

    Valid enumerator examples are `Enumerator`, `Enumerator::Lazy`, `Enumerator::Chain`, `Enumerator::ArithmeticSequence`, etc.

    Classes like `Array`, `Hash`, `Set` are also valid, since their `#each` methods return `Enumerator` instances when called without block.
  TEXT

  initialize(message)
end