# class ActiveLdap::Schema::Syntaxes::Boolean

### Public Instance Methods

normalize_value(value) click to toggle source

    # File lib/active_ldap/schema/syntaxes.rb, line 96
    def normalize_value(value)
      case value
      when true, "1"
        "TRUE"
      when false, "0"
        "FALSE"
      else
        value
      end
    end

type_cast(value) click to toggle source

    # File lib/active_ldap/schema/syntaxes.rb, line 85
    def type_cast(value)
      case value
      when "TRUE"
        true
      when "FALSE"
        false
      else
        value
      end
    end

### Private Instance Methods

validate_normalized_value(value, original_value) click to toggle source

    # File lib/active_ldap/schema/syntaxes.rb, line 108
    def validate_normalized_value(value, original_value)
      if %w(TRUE FALSE).include?(value)
        nil
      else
        _("%s should be TRUE or FALSE") % original_value.inspect
      end
    end