Exception: ActiveLdap::LdifInvalid — activeldap - ActiveLdap

Exception: ActiveLdap::LdifInvalid

Inherits:
Error
  • Object
show all
Defined in:
lib/active_ldap/base.rb

Constant Summary

NEAREST_MARK =
"|@|"

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (LdifInvalid) initialize(ldif, reason = nil, line = nil, column = nil)

Returns a new instance of LdifInvalid



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/active_ldap/base.rb', line 155

def initialize(ldif, reason=nil, line=nil, column=nil)
  @ldif = ldif
  @reason = reason
  @line = line
  @column = column
  @nearest = nil
  if @reason
    message = _("invalid LDIF: %s:") % @reason
  else
    message = _("invalid LDIF:")
  end
  if @line and @column
    @nearest = detect_nearest(@line, @column)
    snippet = generate_snippet
    message << "\n#{snippet}\n"
  end
  super("#{message}\n#{numbered_ldif}")
end

Instance Attribute Details

- (Object) column (readonly)

Returns the value of attribute column



154
155
156
# File 'lib/active_ldap/base.rb', line 154

def column
  @column
end

- (Object) ldif (readonly)

Returns the value of attribute ldif



154
155
156
# File 'lib/active_ldap/base.rb', line 154

def ldif
  @ldif
end

- (Object) line (readonly)

Returns the value of attribute line



154
155
156
# File 'lib/active_ldap/base.rb', line 154

def line
  @line
end

- (Object) nearest (readonly)

Returns the value of attribute nearest



154
155
156
# File 'lib/active_ldap/base.rb', line 154

def nearest
  @nearest
end

- (Object) reason (readonly)

Returns the value of attribute reason



154
155
156
# File 'lib/active_ldap/base.rb', line 154

def reason
  @reason
end