Sha256: d170161a3cdbda3ff9b8e889e64a5922f23f2c51b6e4798b2311f9ed38b72c25

Contents?: true

Size: 608 Bytes

Versions: 10

Compression:

Stored size: 608 Bytes

Contents

class Acs::Ldap::Result
  def initialize(result, data = nil, log = false)
    @code = result.code
    @dn = result.matched_dn
    @message = result.message
    @data = data
    logger.info to_s if log
  end

  def success?
    @code == 0
  end

  def code
    @code
  end

  def dn
    @dn
  end

  def message
    @message
  end

  def data=(data)
    @data = data
  end

  def data
    @data
  end

  def to_s
    result = success? ? 'SUCCESS' : 'ERROR'
    "#{result} return code:#{@code}, matched_dn: #{@dn}, message:#{@message}, data:#{@data.inspect}"
  end

  def logger
    Acs::Ldap.logger
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
acs-ldap-0.2.6 lib/acs/ldap/result.rb
acs-ldap-0.2.5 lib/acs/ldap/result.rb
acs-ldap-0.2.4 lib/acs/ldap/result.rb
acs-ldap-0.2.3 lib/acs/ldap/result.rb
acs-ldap-0.2.2 lib/acs/ldap/result.rb
acs-ldap-0.2.1 lib/acs/ldap/result.rb
acs-ldap-0.2.0 lib/acs/ldap/result.rb
acs-ldap-0.1.4 lib/acs/ldap/result.rb
acs-ldap-0.1.3 lib/acs/ldap/result.rb
acs-ldap-0.1.2 lib/acs/ldap/result.rb