lib/gorillib/receiver.rb in gorillib-0.1.7 vs lib/gorillib/receiver.rb in gorillib-0.1.8

- old
+ new

@@ -210,10 +210,10 @@ # # @param hsh [Hash] attr-value pairs to set on the newly created object. # @param *args [Array] arguments to pass to the constructor # @return [Object] a new instance def receive *args - hsh = args.pop + hsh = args.pop || {} raise ArgumentError, "Can't receive (it isn't hashlike): {#{hsh.inspect}} -- the hsh should be the *last* arg" unless hsh.respond_to?(:[]) && hsh.respond_to?(:has_key?) obj = self.new(*args) obj.receive!(hsh) end