Class: ActiveLdap::Schema::Syntaxes::Boolean

Inherits:
Base
  • Object
show all
Defined in:
lib/active_ldap/schema/syntaxes.rb

Constant Summary

Constants inherited from Base

ActiveLdap::Schema::Syntaxes::Base::PRINTABLE_CHARACTER, ActiveLdap::Schema::Syntaxes::Base::SYNTAXES, ActiveLdap::Schema::Syntaxes::Base::UNPRINTABLE_CHARACTER

Instance Method Summary collapse

Methods inherited from Base

#binary?, #valid?, #validate

Instance Method Details

#normalize_value(value) ⇒ Object



96
97
98
99
100
101
102
103
104
105
# 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) ⇒ Object



85
86
87
88
89
90
91
92
93
94
# 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