The Registry is a container of unique DeprecatedMethod instances. Normally there is only one in existence and it is accessed via ‘Deprecatable.registry’
Initialize the Registry, which amounts to creating a new Hash.
Returns nothing.
# File lib/deprecatable/registry.rb, line 9 def initialize @registry = Hash.new end
Public: Remove all items from the Registry.
Returns nothing.
# File lib/deprecatable/registry.rb, line 34 def clear @registry.clear end
Public: Iterate over all items in the Registry
Yields each DeprecatedMethod in the Registry Returns nothing.
# File lib/deprecatable/registry.rb, line 25 def each items.each do |i| yield i end end
Public: Return all the DeprecatedMethod instances in the registry.
Returns an Array of DeprecatedMethod instances.
# File lib/deprecatable/registry.rb, line 51 def items @registry.keys end
Public: Register a method to be deprecated.
method - An instance of DeprecatedMethod
Returns the instance that was passed in.
# File lib/deprecatable/registry.rb, line 43 def register( dm ) @registry[dm] = true return dm end
Public: Return the number of instances of DeprecatedMethod there are in the Registry.
Returns an Integer of the size of the Regsitry.
# File lib/deprecatable/registry.rb, line 17 def size() @registry.size end
Generated with the Darkfish Rdoc Generator 2.