Class: Mutant::Transform::Index Private
- Inherits:
-
Mutant::Transform
- Object
- Mutant::Transform
- Mutant::Transform::Index
- 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
-
.wrap(cause, index) ⇒ Error
private
Create error at specified index.
Instance Method Summary collapse
-
#apply(input) ⇒ Either<Error, Object>
private
Apply transformation to input.
-
#slug ⇒ Array<String>
private
Rendering slug.
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
159 160 161 162 163 164 165 166 |
# File 'lib/mutant/transform.rb', line 159 def self.wrap(cause, index) Error.new( cause: cause, input: cause.input, message: nil, transform: new(index: index, transform: cause.transform) ) end |
Instance Method Details
#apply(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
173 174 175 |
# File 'lib/mutant/transform.rb', line 173 def apply(input) transform.apply(input).lmap(&method(:wrap_error)) end |
#slug ⇒ Array<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
180 181 182 |
# File 'lib/mutant/transform.rb', line 180 def slug '%<index>d' % { index: index } end |