Exception: ActiveLdap::LdifInvalid

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

Constant Summary collapse

NEAREST_MARK =
"|@|"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GetTextSupport

included

Constructor Details

#initialize(ldif, reason = nil, line = nil, column = nil) ⇒ LdifInvalid

Returns a new instance of LdifInvalid.



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

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

#columnObject (readonly)

Returns the value of attribute column.



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

def column
  @column
end

#ldifObject (readonly)

Returns the value of attribute ldif.



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

def ldif
  @ldif
end

#lineObject (readonly)

Returns the value of attribute line.



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

def line
  @line
end

#nearestObject (readonly)

Returns the value of attribute nearest.



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

def nearest
  @nearest
end

#reasonObject (readonly)

Returns the value of attribute reason.



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

def reason
  @reason
end