Class: ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Commands::CastStepAwareEnumerable
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Commands::CastStepAwareEnumerable
- Defined in:
- lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerable.rb
Constant Summary collapse
- RUBY_CLASS_TO_STEP_AWARE_CLASS_MAP =
{ ::Array => Entities::StepAwareEnumerables::Array, ::Hash => Entities::StepAwareEnumerables::Hash, ::Set => Entities::StepAwareEnumerables::Set, ::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
51 52 53 54 55 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerable.rb', line 51 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.
31 32 33 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerable.rb', line 31 def object @object end |
#organizer ⇒ Object (readonly)
Returns the value of attribute organizer.
37 38 39 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerable.rb', line 37 def organizer @organizer end |
#propagated_result ⇒ Object (readonly)
Returns the value of attribute propagated_result.
43 44 45 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerable.rb', line 43 def propagated_result @propagated_result end |
Instance Method Details
#call ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerable
61 62 63 |
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/commands/cast_step_aware_enumerable.rb', line 61 def call step_aware_enumerable_klass&.new(**attributes) || ::ConvenientService.raise(Exceptions::ObjectIsNotEnumerable.new(object: object)) end |