# File lib/active_ldap/schema/syntaxes.rb, line 56 def normalize_value(value) if value.is_a?(String) and /\A[01]*\z/ =~ value "'#{value}'B" else value end end
# File lib/active_ldap/schema/syntaxes.rb, line 47 def type_cast(value) return nil if value.nil? if /\A'([01]*)'B\z/ =~ value.to_s $1 else value end end
# File lib/active_ldap/schema/syntaxes.rb, line 65 def validate_normalized_value(value, original_value) if /\A'/ !~ value return _("%s doesn't have the first \"'\"") % original_value.inspect end if /'B\z/ !~ value return _("%s doesn't have the last \"'B\"") % original_value.inspect end if /([^01])/ =~ value[1..-3] return _("%s has invalid character '%s'") % [value.inspect, $1] end nil end