Class: Morpher::Transform::Block
- Inherits:
-
Morpher::Transform
- Object
- Morpher::Transform
- Morpher::Transform::Block
- Defined in:
- lib/morpher/transform.rb
Overview
Transform based on a (captured) block with added name
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Morpher::Transform
Class Method Details
.capture(name, &block) ⇒ Object
106 107 108 |
# File 'lib/morpher/transform.rb', line 106 def self.capture(name, &block) new(block: block, name: name) end |
Instance Method Details
#call(input) ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/morpher/transform.rb', line 110 def call(input) block .call(input) .lmap do || Error.new( cause: nil, input: input, message: , transform: self ) end end |
#slug ⇒ Object
123 124 125 |
# File 'lib/morpher/transform.rb', line 123 def slug name end |