class Morpher::Transform::Boolean

Transform guarding boolean primitives

Constants

MESSAGE

Public Instance Methods

call(input) click to toggle source

Apply transformation to input

@param [Object] input

@return [Either<Error, Object>]

# File lib/morpher/transform.rb, line 249
def call(input)
  if input.equal?(true) || input.equal?(false)
    success(input)
  else
    failure(
      error(
        message: MESSAGE % { actual: input.inspect },
        input:   input
      )
    )
  end
end