Module: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::CanHaveParentResult::Concern Private
- Includes:
- ConvenientService::Support::Concern
- Defined in:
- lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_parent_result/concern.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #parent ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result? private
- #parents(include_self: false, limit: Constants::PARENTS_LIMIT) ⇒ Array<ConvenientService::Service::Plugins::HasJSendResult::Entities::Result> private
- #parents_enum(include_self: false, limit: Constants::PARENTS_LIMIT) ⇒ Enumerator<ConvenientService::Service::Plugins::HasJSendResult::Entities::Result> private
Methods included from ConvenientService::Support::Concern
Instance Method Details
#parent ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_parent_result/concern.rb', line 26 def parent Utils.memoize_including_falsy_values(self, :@parent) { extra_kwargs[:parent] } end |
#parents(include_self: false, limit: Constants::PARENTS_LIMIT) ⇒ Array<ConvenientService::Service::Plugins::HasJSendResult::Entities::Result>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
58 59 60 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_parent_result/concern.rb', line 58 def parents(include_self: false, limit: Constants::PARENTS_LIMIT) parents_enum(include_self: include_self, limit: limit).to_a end |
#parents_enum(include_self: false, limit: Constants::PARENTS_LIMIT) ⇒ Enumerator<ConvenientService::Service::Plugins::HasJSendResult::Entities::Result>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_parent_result/concern.rb', line 69 def parents_enum(include_self: false, limit: Constants::PARENTS_LIMIT) ::Enumerator.new do |yielder| yielder.yield(self) if include_self ## # NOTE: Empty parentheses are used to force a method call # https://docs.ruby-lang.org/en/2.7.0/syntax/assignment_rdoc.html#label-Local+Variables+and+Methods # parent = parent() ## # NOTE: `finite_loop` is used to avoid even a theoretical infinite loop. # Support::FiniteLoop.finite_loop(max_iteration_count: limit, raise_on_exceedance: false) do break unless parent yielder.yield(parent) parent = parent.parent end end end |