Class: ASF::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/whimsy/asf/ldap.rb,
lib/whimsy/asf/committee.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(name) ⇒ Base
Returns a new instance of Base.
234
235
236
237
|
# File 'lib/whimsy/asf/ldap.rb', line 234
def initialize name
self.class.collection[name] = WeakRef.new(self)
@name = name
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
202
203
204
|
# File 'lib/whimsy/asf/ldap.rb', line 202
def name
@name
end
|
Class Method Details
.[](name) ⇒ Object
216
217
218
|
# File 'lib/whimsy/asf/ldap.rb', line 216
def self.[] name
new(name)
end
|
.base ⇒ Object
204
205
206
|
# File 'lib/whimsy/asf/ldap.rb', line 204
def self.base
@base
end
|
.collection ⇒ Object
212
213
214
|
# File 'lib/whimsy/asf/ldap.rb', line 212
def self.collection
@collection ||= Hash.new
end
|
.find(name) ⇒ Object
220
221
222
|
# File 'lib/whimsy/asf/ldap.rb', line 220
def self.find name
new(name)
end
|
.new(name) ⇒ Object
224
225
226
227
228
229
230
231
232
|
# File 'lib/whimsy/asf/ldap.rb', line 224
def self.new name
begin
object = collection[name]
return object.reference if object and object.weakref_alive?
rescue
end
super
end
|
Instance Method Details
#base ⇒ Object
208
209
210
|
# File 'lib/whimsy/asf/ldap.rb', line 208
def base
self.class.base
end
|
#id ⇒ Object
248
249
250
|
# File 'lib/whimsy/asf/ldap.rb', line 248
def id
@name
end
|
#reference ⇒ Object
239
240
241
|
# File 'lib/whimsy/asf/ldap.rb', line 239
def reference
self
end
|
#weakref(attr, &block) ⇒ Object
243
244
245
|
# File 'lib/whimsy/asf/ldap.rb', line 243
def weakref(attr, &block)
ASF.dereference_weakref(self, attr, &block)
end
|