Class: ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Commands::CastStepAwareEnumerator
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Commands::CastStepAwareEnumerator
- Defined in:
- lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerator.rb
Constant Summary collapse
- RUBY_CLASS_TO_STEP_AWARE_CLASS_MAP =
{ ::Enumerator => Entities::StepAwareEnumerables::Enumerator, ::Enumerator::Lazy => Entities::StepAwareEnumerables::LazyEnumerator, ::Enumerator::Chain => Entities::StepAwareEnumerables::ChainEnumerator, ::Enumerator::ArithmeticSequence => Entities::StepAwareEnumerables::ArithmeticSequenceEnumerator }
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#organizer ⇒ Object
readonly
Returns the value of attribute organizer.
-
#propagated_result ⇒ Object
readonly
Returns the value of attribute propagated_result.
Instance Method Summary collapse
- #call ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerable
- #initialize(object:, organizer:, propagated_result: nil) ⇒ void constructor
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(object:, organizer:, propagated_result: nil) ⇒ void
48 49 50 51 52 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerator.rb', line 48 def initialize(object:, organizer:, propagated_result: nil) @object = object @organizer = organizer @propagated_result = propagated_result end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
28 29 30 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerator.rb', line 28 def object @object end |
#organizer ⇒ Object (readonly)
Returns the value of attribute organizer.
34 35 36 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerator.rb', line 34 def organizer @organizer end |
#propagated_result ⇒ Object (readonly)
Returns the value of attribute propagated_result.
40 41 42 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerator.rb', line 40 def propagated_result @propagated_result end |
Instance Method Details
#call ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerable
58 59 60 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerator.rb', line 58 def call step_aware_enumerable_klass&.new(**attributes) || ::ConvenientService.raise(Exceptions::ObjectIsNotEnumerator.new(object: object)) end |