Class: Mutant::Transform::Index 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.

Index attached to a transform

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.wrap(cause, index) ⇒ Error

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.

Create error at specified index



126
127
128
129
130
131
132
133
# File 'lib/mutant/transform.rb', line 126

def self.wrap(cause, index)
  Error.new(
    cause:,
    input:     cause.input,
    message:   nil,
    transform: new(index:, transform: cause.transform)
  )
end

Instance Method Details

#call(input) ⇒ Either<Error, 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.

Apply transformation to input



140
141
142
# File 'lib/mutant/transform.rb', line 140

def call(input)
  transform.call(input).lmap(&method(:wrap_error))
end

#slugArray<String>

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.

Rendering slug



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

def slug = '%<index>d' % { index: }