Class: ActiveAgent::Delegation::Contract::DSL Private
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ActiveAgent::Delegation::Contract::DSL
- Defined in:
- lib/active_agent/delegation/contract.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.
Wraps the input schema DSL so that returns inside a delegation block
declares the output shape rather than an input property.
Instance Method Summary collapse
-
#initialize(contract, schema) ⇒ DSL
constructor
private
A new instance of DSL.
-
#returns(source = nil) { ... } ⇒ Schema
private
Declares the shape the action returns.
Constructor Details
#initialize(contract, schema) ⇒ DSL
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.
Returns a new instance of DSL.
101 102 103 104 |
# File 'lib/active_agent/delegation/contract.rb', line 101 def initialize(contract, schema) @contract = contract super(schema) end |
Instance Method Details
#returns(source = nil) { ... } ⇒ Schema
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.
Declares the shape the action returns.
111 112 113 |
# File 'lib/active_agent/delegation/contract.rb', line 111 def returns(source = nil, &block) @contract.returns = Schema.build(source, &block) end |