Class: ActiveLdap::Schema::Syntaxes::Boolean — activeldap - ActiveLdap

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

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

Constant Summary

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

- (Object) normalize_value(value)



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

- (Object) type_cast(value)



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