Class: Mutant::Transform::Block Private

Inherits:
Mutant::Transform show all
Defined in:
lib/mutant/transform.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Named

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.capture(name, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



79
80
81
# File 'lib/mutant/transform.rb', line 79

def self.capture(name, &block)
  new(block: block, name: name)
end

Instance Method Details

#call(input) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/mutant/transform.rb', line 83

def call(input)
  block
    .call(input)
    .lmap do |message|
      Error.new(
        cause:     nil,
        input:     input,
        message:   message,
        transform: self
      )
    end
end

#slugObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



96
97
98
# File 'lib/mutant/transform.rb', line 96

def slug
  name
end