Module: Flows::Plugin::OutputContract::Wrapper Private
- Defined in:
- lib/flows/plugin/output_contract/wrapper.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.
Contains wrappers for initializer and #call methods.
Defined Under Namespace
Modules: Util
Instance Method Summary collapse
- #call(*args, &block) ⇒ Object private
- #initialize(*args, &block) ⇒ Object private
Instance Method Details
#call(*args, &block) ⇒ Object
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.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flows/plugin/output_contract/wrapper.rb', line 14 def call(*args, &block) result = super(*args, &block) klass = self.class contract = Util.contract_for(klass, result) Util.transform_result(klass, contract, result) result end |
#initialize(*args, &block) ⇒ Object
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.
8 9 10 11 12 |
# File 'lib/flows/plugin/output_contract/wrapper.rb', line 8 def initialize(*args, &block) super(*args, &block) klass = self.class raise NoContractError, klass if klass.success_contracts.empty? end |