Class: SmartCore::Types::Primitive::InvariantControl::Chain::Result Private
- Inherits:
-
Object
- Object
- SmartCore::Types::Primitive::InvariantControl::Chain::Result
- Defined in:
- lib/smart_core/types/primitive/invariant_control/chain/result.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #checked_value ⇒ Any readonly private
- #invariant_chain ⇒ SmartCore::Types::Primitive::invariantControl::Chain readonly private
Instance Method Summary collapse
- #error_codes ⇒ Array<String> private
- #failure? ⇒ Boolean private
- #initialize(invariant_chain, checked_value, invariant_results) ⇒ void constructor private
- #success? ⇒ Boolean private
Constructor Details
#initialize(invariant_chain, checked_value, invariant_results) ⇒ void
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.
25 26 27 28 29 |
# File 'lib/smart_core/types/primitive/invariant_control/chain/result.rb', line 25 def initialize(invariant_chain, checked_value, invariant_results) @invariant_chain = invariant_chain @checked_value = checked_value @invariant_results = invariant_results end |
Instance Attribute Details
#checked_value ⇒ Any (readonly)
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.
16 17 18 |
# File 'lib/smart_core/types/primitive/invariant_control/chain/result.rb', line 16 def checked_value @checked_value end |
#invariant_chain ⇒ SmartCore::Types::Primitive::invariantControl::Chain (readonly)
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.
10 11 12 |
# File 'lib/smart_core/types/primitive/invariant_control/chain/result.rb', line 10 def invariant_chain @invariant_chain end |
Instance Method Details
#error_codes ⇒ Array<String>
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.
51 52 53 54 55 |
# File 'lib/smart_core/types/primitive/invariant_control/chain/result.rb', line 51 def error_codes invariant_results.select(&:failure?).map! do |invariant_result| "#{invariant_chain.name}.#{invariant_result.invariant.name}".tap(&:freeze) end end |
#failure? ⇒ Boolean
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.
43 44 45 |
# File 'lib/smart_core/types/primitive/invariant_control/chain/result.rb', line 43 def failure? invariant_results.any?(&:failure?) end |
#success? ⇒ Boolean
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.
35 36 37 |
# File 'lib/smart_core/types/primitive/invariant_control/chain/result.rb', line 35 def success? invariant_results.all?(&:success?) end |