# File lib/erector/dependencies.rb, line 3 def push(*new_dependencies_args) new_dependencies = new_dependencies_args.select do |new_dependency| !include?(new_dependency) end new_dependencies.each do |dep| unless dep.is_a? Erector::Dependency raise "expected Dependency, got #{dep.class}: #{dep.inspect}" end end super(*new_dependencies) end
# File lib/erector/dependencies.rb, line 17 def uniq inject(self.class.new) do |memo, item| memo << item unless memo.any? {|memo_item| memo_item == item} memo end end