Class: Dry::Pipeline

Inherits:
Object
  • Object
show all
Includes:
Mixin
Defined in:
lib/dry/pipeline.rb,
lib/dry/pipeline/mixin.rb,
lib/dry/pipeline/version.rb,
lib/dry/pipeline/composite.rb

Defined Under Namespace

Modules: Mixin Classes: Composite

Constant Summary collapse

VERSION =
'0.0.2'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mixin

#>>

Constructor Details

#initialize(fn = nil, &block) ⇒ Pipeline

Returns a new instance of Pipeline.



11
12
13
# File 'lib/dry/pipeline.rb', line 11

def initialize(fn = nil, *, &block)
  @fn = block_given? ? block : fn
end

Instance Attribute Details

#fnObject (readonly)

Returns the value of attribute fn.



9
10
11
# File 'lib/dry/pipeline.rb', line 9

def fn
  @fn
end

Instance Method Details

#call(input) ⇒ Object



15
16
17
# File 'lib/dry/pipeline.rb', line 15

def call(input)
  fn.(input)
end