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

API:

  • private

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.

API:

  • private



69
70
71
# File 'lib/mutant/transform.rb', line 69

def self.capture(name, &block)
  new(block:, 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.

API:

  • private



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mutant/transform.rb', line 73

def call(input)
  block
    .call(input)
    .lmap do |message|
      Error.new(
        cause:     nil,
        input:,
        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.

API:

  • private



86
# File 'lib/mutant/transform.rb', line 86

def slug = name