In Files

  • uri/ldap.rb

URI::LDAP

LDAP URI SCHEMA (described in RFC2255) ldap:///[?[?[?]]]

Public Class Methods

build(args) click to toggle source
 
               # File uri/ldap.rb, line 41
def self.build(args)
  tmp = Util::make_components_hash(self, args)

  if tmp[:dn]
    tmp[:path] = tmp[:dn]
  end

  query = []
  [:extensions, :filter, :scope, :attributes].collect do |x|
    next if !tmp[x] && query.size == 0
    query.unshift(tmp[x])
  end

  tmp[:query] = query.join('?')

  return super(tmp)
end
            
new(*arg) click to toggle source
 
               # File uri/ldap.rb, line 59
def initialize(*arg)
  super(*arg)

  if @fragment
    raise InvalidURIError, 'bad LDAP URL'
  end

  parse_dn
  parse_query
end
            

Public Instance Methods

attributes() click to toggle source
 
               # File uri/ldap.rb, line 120
def attributes
  @attributes
end
            
attributes=(val) click to toggle source
 
               # File uri/ldap.rb, line 131
def attributes=(val)
  set_attributes(val)
  val
end
            
dn() click to toggle source
 
               # File uri/ldap.rb, line 104
def dn
  @dn
end
            
dn=(val) click to toggle source
 
               # File uri/ldap.rb, line 115
def dn=(val)
  set_dn(val)
  val
end
            
extensions() click to toggle source
 
               # File uri/ldap.rb, line 168
def extensions
  @extensions
end
            
extensions=(val) click to toggle source
 
               # File uri/ldap.rb, line 179
def extensions=(val)
  set_extensions(val)
  val
end
            
filter() click to toggle source
 
               # File uri/ldap.rb, line 152
def filter
  @filter
end
            
filter=(val) click to toggle source
 
               # File uri/ldap.rb, line 163
def filter=(val)
  set_filter(val)
  val
end
            
hierarchical?() click to toggle source
 
               # File uri/ldap.rb, line 184
def hierarchical?
  false
end
            
scope() click to toggle source
 
               # File uri/ldap.rb, line 136
def scope
  @scope
end
            
scope=(val) click to toggle source
 
               # File uri/ldap.rb, line 147
def scope=(val)
  set_scope(val)
  val
end
            

Protected Instance Methods

set_attributes(val) click to toggle source
 
               # File uri/ldap.rb, line 124
def set_attributes(val)
  @attributes = val
  build_path_query
  @attributes
end
            
set_dn(val) click to toggle source
 
               # File uri/ldap.rb, line 108
def set_dn(val)
  @dn = val
  build_path_query
  @dn
end
            
set_extensions(val) click to toggle source
 
               # File uri/ldap.rb, line 172
def set_extensions(val)
  @extensions = val
  build_path_query
  @extensions
end
            
set_filter(val) click to toggle source
 
               # File uri/ldap.rb, line 156
def set_filter(val)
  @filter = val
  build_path_query
  @filter
end
            
set_scope(val) click to toggle source
 
               # File uri/ldap.rb, line 140
def set_scope(val)
  @scope = val
  build_path_query
  @scope
end