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

Class: ActiveLdap::Schema::Syntaxes::Integer

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

Constant Summary

Constant Summary

Constants inherited from Base

Base::PRINTABLE_CHARACTER, Base::SYNTAXES, Base::UNPRINTABLE_CHARACTER

Instance Method Summary (collapse)

Methods inherited from Base

#binary?, #valid?, #validate

Instance Method Details

- (Object) normalize_value(value)



261
262
263
264
265
266
267
# File 'lib/active_ldap/schema/syntaxes.rb', line 261

def normalize_value(value)
  if value.is_a?(::Integer)
    value.to_s
  else
    value
  end
end

- (Object) type_cast(value)



252
253
254
255
256
257
258
259
# File 'lib/active_ldap/schema/syntaxes.rb', line 252

def type_cast(value)
  return value if value.nil?
  begin
    Integer(value)
  rescue ArgumentError
    value
  end
end