Sha256: 1a4d9435e567c294fe414b5ee9164b540cb4b321a5f064fc6117234f07c35f64

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 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' : 'FAILED'
    "#{result} return code:#{@code}, matched_dn: #{@dn}, message:#{@message}, data:#{@data.inspect}"
  end

  def logger
    Acs::Ldap.logger
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acs-ldap-0.2.7 lib/acs/ldap/result.rb