Sha256: cb19e84c3a248cec1380a4a5c6eb90a022795f654edbefdd386f8d0a9db7a2ae

Contents?: true

Size: 1.68 KB

Versions: 6

Compression:

Stored size: 1.68 KB

Contents

require 'slf4r/logger'
require 'ldap/digest'

# dummy implementation which turns the extra ldap configuration noops
module DataMapper
  module Resource
 
    module ClassMethods
 
      include ::Slf4r::Logger

      def ldap_properties(resource = nil, &block)
        if block
          @ldap_properties = block
        elsif resource.instance_of? Hash
          @ldap_properties = resource
          logger.debug { "ldap_properties=#{@ldap_properties.inspect}" }
        elsif resource
          logger.debug { "ldap_properties=#{@ldap_properties.call(resource).inspect}" }
        else
          logger.debug { "ldap_properties=#{@ldap_properties.inspect}" }
        end
      end
      
      def treebase(resource = nil, &block)
        if block
          @treebase = block
        elsif resource.instance_of? String
          @treebase = resource
          logger.debug { "treebase=#{@treebase.inspect}" }
        elsif resource
          logger.debug { "treebase=#{@treebase.call(resource).inspect}" }
        else
          logger.debug { "treebase=#{@treebase}" }
        end
      end
      
      def dn_prefix(resource = nil, &block)
        if block
          @dn_prefix = block
        elsif resource.instance_of? Hash
          @dn_prefix = resource
          logger.debug { "dn_prefix=#{@dn_prefix.inspect}" }
        elsif resource
          logger.debug { "dn_prefix=#{@dn_prefix.call(resource).inspect}" }
        else
          logger.debug { "dn_prefix=#{dn_prefix}" }
        end
      end
      
      def multivalue_field(field = nil)
        logger.debug { "multivalue_field = #{field}" } if field
      end
    end
    
    def authenticate(password)
      raise "NotImplemented"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dm-ldap-adapter-0.3.5 lib/dummy_ldap_resource.rb
dm-ldap-adapter-0.3.4 lib/dummy_ldap_resource.rb
dm-ldap-adapter-0.3.1 lib/dummy_ldap_resource.rb
dm-ldap-adapter-0.3.2 lib/dummy_ldap_resource.rb
dm-ldap-adapter-0.3.3 lib/dummy_ldap_resource.rb
dm-ldap-adapter-0.3.0 lib/dummy_ldap_resource.rb