Parent

Methods

Included Modules

Files

Class/Module Index [+]

Quicksearch

ActiveLdap::Ldif::Parser

Attributes

ldif[R]

Public Class Methods

new(source) click to toggle source
# File lib/active_ldap/ldif.rb, line 96
def initialize(source)
  @ldif = nil
  source = source.to_s if source.is_a?(LDIF)
  @source = source
end

Public Instance Methods

parse() click to toggle source
# File lib/active_ldap/ldif.rb, line 107
def parse
  return @ldif if @ldif

  @scanner = Scanner.new(@source)
  raise version_spec_is_missing unless @scanner.scan(/version:/)
  @scanner.scan(FILL)

  version = @scanner.scan(/\d+/)
  raise version_number_is_missing if version.nil?

  version = Integer(version)
  raise unsupported_version(version) if version != 1

  raise separator_is_missing unless @scanner.scan_separators

  records = parse_records

  @ldif = LDIF.new(records)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.