Class: Rivulet::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/rivulet/step.rb

Class Method Summary collapse

Class Method Details

.container_class_pathObject



5
6
7
8
9
10
11
12
# File 'lib/rivulet/step.rb', line 5

def self.container_class_path
  self
    .name
    .split('::')
    .then { |path| path[0...path.index('Steps')] }
    .push('Container')
    .inject(Object) { |mod, name| mod.const_get(name) }
end

.inherited(subclass) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/rivulet/step.rb', line 14

def self.inherited(subclass)
  super
  subclass.prepend(Rivulet::Telemetry::TimingWrapper)
  subclass.const_set(
    :Import, Dry::AutoInject(subclass.container_class_path)
  )
end