class Extant::Coercers::Boolean

Public Instance Methods

coerce() click to toggle source
# File lib/extant/coercers/boolean.rb, line 3
def coerce
  if [true, "true", 1].include?(value)
    self.coerced = true
    return true
  elsif [false, "false", 0].include?(value)
    self.coerced = true
    return false
  end

  Extant::UncoercedValue
end