Module: Ldaptic::Syntaxes

Defined in:
lib/ldaptic/syntaxes.rb

Overview

The classes nestled here are responsible for casting attributes to and from the appropriate type. End users generally need not interact with these directly.

Defined Under Namespace

Classes: Abstract, BitString, Boolean, CountryString, DN, DeliveryMethod, DirectoryString, FacsimileTelephoneNumber, GeneralizedTime, IA5String, INTEGER, LDAPSyntaxDescription, OctetString, OtherMailbox, PostalAddress, PrintableString, TelephoneNumber, TelexNumber

Class Method Summary collapse

Class Method Details

.for(string) ⇒ Object

Returns the class for a given syntax name. Falls back to OctetString if there is not a more specific handler.

Ldaptic::Syntaxes.for("Generalized Time")
#=> Ldaptic::Syntaxes::GeneralizedTime


89
90
91
92
93
94
95
96
# File 'lib/ldaptic/syntaxes.rb', line 89

def self.for(string)
  string = string.delete(' ')
  if const_defined?(string)
    const_get(string)
  else
    OctetString
  end
end