Class: Interactors::Anonymous

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from FunctionalInteractor

#compose

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

#blockObject (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