Class: Mutant::Transform::Boolean Private
- Inherits:
-
Mutant::Transform
- Object
- Mutant::Transform
- Mutant::Transform::Boolean
- 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.
Transform guarding boolean primitives
Constant Summary collapse
- MESSAGE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'Expected: boolean but got: %<actual>s'
Instance Method Summary collapse
-
#apply(input) ⇒ Either<Error, Object>
private
Apply transformation to input.
Methods inherited from Mutant::Transform
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
190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/mutant/transform.rb', line 190 def apply(input) if input.equal?(true) || input.equal?(false) success(input) else failure( error( message: MESSAGE % { actual: input.inspect }, input: input ) ) end end |