Parent

Class Index [+]

Quicksearch

ActiveLdap::Association::Proxy

Public Class Methods

new(owner, options) click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 8
 8:       def initialize(owner, options)
 9:         @owner = owner
10:         @options = options
11:         reset
12:         extend(options[:extend]) if options[:extend]
13:       end

Public Instance Methods

===(other) click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 20
20:       def ===(other)
21:         load_target and other === @target
22:       end
exists?() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 51
51:       def exists?
52:         load_target
53:         not @target.nil?
54:       end
loaded() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 38
38:       def loaded
39:         @loaded = true
40:       end
loaded?() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 34
34:       def loaded?
35:         @loaded
36:       end
proxy_respond_to?(symbol, include_priv=false) click to toggle source
Alias for: respond_to?
reload() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 29
29:       def reload
30:         reset
31:         load_target
32:       end
reset() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 24
24:       def reset
25:         @target = nil
26:         @loaded = false
27:       end
respond_to?(symbol, include_priv=false) click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 15
15:       def respond_to?(symbol, include_priv=false)
16:         proxy_respond_to?(symbol, include_priv) or
17:           (load_target && @target.respond_to?(symbol, include_priv))
18:       end
Also aliased as: proxy_respond_to?
target() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 42
42:       def target
43:         @target
44:       end
target=(target) click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 46
46:       def target=(target)
47:         @target = target
48:         loaded
49:       end

Private Instance Methods

find_options(options={}) click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 93
93:       def find_options(options={})
94:         if @owner.connection != @owner.class.connection
95:           {:connection => @owner.connection}.merge(options)
96:         else
97:           options
98:         end
99:       end
foreign_class() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 62
62:       def foreign_class
63:         klass = @owner.class.associated_class(@options[:association_id])
64:         klass = @owner.class.module_eval(klass) if klass.is_a?(String)
65:         klass
66:       end
foreign_key() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 76
76:       def foreign_key
77:         @options[:foreign_key_name] || foreign_class.dn_attribute
78:       end
have_foreign_key?() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 68
68:       def have_foreign_key?
69:         false
70:       end
infect_connection(target) click to toggle source
     # File lib/active_ldap/association/proxy.rb, line 101
101:       def infect_connection(target)
102:         conn = @owner.instance_variable_get("@connection")
103:         target.connection = conn if conn
104:       end
load_target() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 80
80:       def load_target
81:         if !@owner.new_entry? or have_foreign_key?
82:           begin
83:             @target = find_target unless loaded?
84:           rescue EntryNotFound
85:             reset
86:           end
87:         end
88: 
89:         loaded if target
90:         target
91:       end
method_missing(method, *args, &block) click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 57
57:       def method_missing(method, *args, &block)
58:         load_target
59:         @target.send(method, *args, &block)
60:       end
primary_key() click to toggle source
    # File lib/active_ldap/association/proxy.rb, line 72
72:       def primary_key
73:         @options[:primary_key_name] || @owner.dn_attribute
74:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.