lib/array.rb in dev_commands-0.0.39 vs lib/array.rb in dev_commands-0.0.40
- old
+ new
@@ -1,10 +1,15 @@
class Array
- def execute
+ def execute value=nil
i=0
while i < self.length
self[i]=Command.new(self[i]) if(self[i].is_a?(String))
self[i]=Command.new(self[i]) if(self[i].is_a?(Hash) && !self[i].is_a?(Command))
+
+ if(!value.nil? && value.is_a?(Hash))
+ value.each{|k,v|self[i][k]=v}
+ end
+
self[i].execute if(self[i].is_a?(Command))
i=i+1
end
end
\ No newline at end of file