Class: Trailblazer::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/trailblazer/operation/finder.rb

Defined Under Namespace

Classes: Finder

Class Method Summary collapse

Class Method Details

.Finder(finder_class, action = nil, entity = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/trailblazer/operation/finder.rb', line 3

def self.Finder(finder_class, action = nil, entity = nil)
  task = Activity::Circuit::TaskAdapter.for_step(Finder.new, binary: true)
  injections = [
    :params,
    {:"finder.class" => ->(*) { finder_class }},
    {:"finder.entity" => ->(*) { entity }},
    {:"finder.action" => ->(*) { action }}
  ]

  {task: task, id: "finder.build", inject: injections}
end