Class: Adhearsion::Plugin::Collection

Inherits:
Array
  • Object
show all
Includes:
TSort
Defined in:
lib/adhearsion/plugin/collection.rb

Instance Method Summary collapse

Instance Method Details

#+(other) ⇒ Object


16
17
18
# File 'lib/adhearsion/plugin/collection.rb', line 16

def +(other)
  Collection.new(to_a + other.to_a)
end

#tsort_each_child(child, &block) ⇒ Object


12
13
14
# File 'lib/adhearsion/plugin/collection.rb', line 12

def tsort_each_child(child, &block)
  select { |i| i.before == child.name || i.name == child.after }.each(&block)
end