Parent

Deprecatable::Registry

The Registry is a container of unique DeprecatedMethod instances. Normally there is only one in existence and it is accessed via ‘Deprecatable.registry

Public Class Methods

new() click to toggle source

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 Instance Methods

clear() click to toggle source

Public: Remove all items from the Registry.

Returns nothing.

# File lib/deprecatable/registry.rb, line 34
def clear
  @registry.clear
end
each() click to toggle source

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
items() click to toggle source

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
register( dm ) click to toggle source

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
size() click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.