Class: Interactors::Anonymous
- Inherits:
-
Object
- Object
- Interactors::Anonymous
- Includes:
- FunctionalInteractor
- Defined in:
- lib/interactors/anonymous.rb
Overview
Anonymous interactors Does two things:
- passes context to the proc
- honors #compose interface
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #call(context = {}) ⇒ Object
-
#initialize(&blk) ⇒ Anonymous
constructor
A new instance of Anonymous.
Methods included from FunctionalInteractor
Constructor Details
#initialize(&blk) ⇒ Anonymous
Returns a new instance of Anonymous.
12 13 14 |
# File 'lib/interactors/anonymous.rb', line 12 def initialize(&blk) @block = blk end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
10 11 12 |
# File 'lib/interactors/anonymous.rb', line 10 def block @block end |
Instance Method Details
#call(context = {}) ⇒ Object
16 17 18 |
# File 'lib/interactors/anonymous.rb', line 16 def call(context = {}) block.call(context) end |