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
-
#call(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
140 141 142 143 144 145 146 147 |
# File 'lib/mutant/transform.rb', line 140 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
154 155 156 |
# File 'lib/mutant/transform.rb', line 154 def call(input) transform.call(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
161 162 163 |
# File 'lib/mutant/transform.rb', line 161 def slug '%<index>d' % { index: } end |