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.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/active_ldap/base.rb', line 142

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.



141
142
143
# File 'lib/active_ldap/base.rb', line 141

def column
  @column
end

#ldifObject (readonly)

Returns the value of attribute ldif.



141
142
143
# File 'lib/active_ldap/base.rb', line 141

def ldif
  @ldif
end

#lineObject (readonly)

Returns the value of attribute line.



141
142
143
# File 'lib/active_ldap/base.rb', line 141

def line
  @line
end

#nearestObject (readonly)

Returns the value of attribute nearest.



141
142
143
# File 'lib/active_ldap/base.rb', line 141

def nearest
  @nearest
end

#reasonObject (readonly)

Returns the value of attribute reason.



141
142
143
# File 'lib/active_ldap/base.rb', line 141

def reason
  @reason
end