def with_metadata(metadata, &block)
      previous_metadata = metadata()
      self.metadata = previous_metadata.merge(metadata)
      block.call if block_given?
    ensure
      self.metadata = previous_metadata
    end
def with_metadata(metadata, &block)
      previous_metadata = metadata()
      self.metadata = previous_metadata.merge(metadata)
      block.call if block_given?
    ensure
      self.metadata = previous_metadata
    end
Set additional metadata for all events published within the provided block
 {http://railseventstore.org/docs/request_metadata#passing-your-own-metadata-using-with_metadata-method Read more}

 @param metadata [Hash] metadata to set for events
 @param block [Proc] block of code during which the metadata will be added
 @return [Object] last value returned by the provided block