Included Modules

Class Index [+]

Quicksearch

DataMapper::DescendantSet

Public Class Methods

new(descendants = []) click to toggle source

Initialize a DescendantSet instance

@param [#] descendants

  initialize with the descendants

@api private

    # File lib/dm-core/support/descendant_set.rb, line 11
11:     def initialize(descendants = [])
12:       @descendants = SubjectSet.new(descendants)
13:     end

Public Instance Methods

<<(descendant) click to toggle source

Add a descendant

@param [Module] descendant

@return [DescendantSet]

  self

@api private

    # File lib/dm-core/support/descendant_set.rb, line 33
33:     def <<(descendant)
34:       @descendants << descendant
35:       self
36:     end
clear() click to toggle source

Removes all entries and returns self

@return [DescendantSet] self

@api private

    # File lib/dm-core/support/descendant_set.rb, line 84
84:     def clear
85:       @descendants.clear
86:     end
delete(descendant) click to toggle source

Remove a descendant

Also removes from all descendants

@param [Module] descendant

@return [DescendantSet]

  self

@api private

    # File lib/dm-core/support/descendant_set.rb, line 48
48:     def delete(descendant)
49:       @descendants.delete(descendant)
50:       each { |d| d.descendants.delete(descendant) }
51:     end
each() click to toggle source

Iterate over each descendant

@yield [descendant] @yieldparam [Module] descendant

@return [DescendantSet]

  self

@api private

    # File lib/dm-core/support/descendant_set.rb, line 62
62:     def each
63:       @descendants.each do |descendant|
64:         yield descendant
65:         descendant.descendants.each { |dd| yield dd }
66:       end
67:       self
68:     end
empty?() click to toggle source

Test if there are any descendants

@return [Boolean]

@api private

    # File lib/dm-core/support/descendant_set.rb, line 75
75:     def empty?
76:       @descendants.empty?
77:     end
initialize_copy(original) click to toggle source

Copy a DescendantSet instance

@param [DescendantSet] original

  the original descendants

@api private

    # File lib/dm-core/support/descendant_set.rb, line 21
21:     def initialize_copy(original)
22:       @descendants = @descendants.dup
23:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.