lib/clamp/command.rb in clamp-0.5.1 vs lib/clamp/command.rb in clamp-0.6.0
- old
+ new
@@ -22,12 +22,15 @@
# Create a command execution.
#
# @param [String] invocation_path the path used to invoke the command
# @param [Hash] context additional data the command may need
#
- def initialize(invocation_path, context = {})
+ def initialize(invocation_path, context = {}, parent_attribute_values = {})
@invocation_path = invocation_path
@context = context
+ parent_attribute_values.each do |attribute, value|
+ instance_variable_set(attribute.ivar_name, value)
+ end
end
# @return [String] the path used to invoke this command
#
attr_reader :invocation_path