lib/dagger/graph.rb in ruby-dagger-0.3.3 vs lib/dagger/graph.rb in ruby-dagger-0.4.0
- old
+ new
@@ -18,12 +18,12 @@
def initialize(mixins: [Tangle::Mixin::Directory], **)
@deferred_edges = []
super
@deferred_edges.each do |args|
- tail, head, *kwargs = args
- add_edge(*[tail, head].map { |name| fetch(name) }, *kwargs)
+ *args, kwargs = args
+ add_edge(*args.map { |name| fetch(name) }, **kwargs)
end
end
def select(&_filter)
vertices.select { |vertex| yield(self, vertex) }
@@ -70,10 +70,10 @@
return '/' if result.empty?
result
end
- def defer_edge(*args)
- @deferred_edges << args
+ def defer_edge(*args, **kwargs)
+ @deferred_edges << [*args, kwargs]
end
end
end