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
242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/morpher/transform.rb', line 242 def call(input) if input.equal?(true) || input.equal?(false) success(input) else failure( error( message: MESSAGE % { actual: input.inspect }, input: input ) ) end end |