Class: Morpher::Transform::Boolean
- Inherits:
-
Morpher::Transform
- Object
- Morpher::Transform
- Morpher::Transform::Boolean
- Defined in:
- lib/morpher/transform.rb
Overview
Transform guarding boolean primitives
Constant Summary collapse
- MESSAGE =
'Expected: boolean but got: %<actual>s'
Instance Method Summary collapse
-
#call(input) ⇒ Either<Error, Object>
Apply transformation to input.
Methods inherited from Morpher::Transform
Instance Method Details
#call(input) ⇒ Either<Error, Object>
Apply transformation to input
219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/morpher/transform.rb', line 219 def call(input) if input.equal?(true) || input.equal?(false) success(input) else failure( error( message: MESSAGE % { actual: input.inspect }, input: input ) ) end end |