lib/rom/commands/graph/class_interface.rb in rom-0.9.1 vs lib/rom/commands/graph/class_interface.rb in rom-1.0.0.beta1
- old
+ new
@@ -22,24 +22,30 @@
options.reduce { |spec, other| build_command(registry, spec, other, path) }
end
# @api private
def build_command(registry, spec, other, path)
- name, nodes = other
+ cmd_opts, nodes = other
key, relation =
if spec.is_a?(Hash)
spec.to_a.first
else
[spec, spec]
end
+ name, opts =
+ if cmd_opts.is_a?(Hash)
+ cmd_opts.to_a.first
+ else
+ [cmd_opts]
+ end
command = registry[relation][name]
tuple_path = Array[*path] << key
input_proc = InputEvaluator.build(tuple_path, nodes)
- command = command.with(input_proc)
+ command = command.with(input_proc, opts)
if nodes
if nodes.all? { |node| node.is_a?(Array) }
command.combine(*nodes.map { |node| build(registry, node, tuple_path) })
else