Method: ModelTimeline.with_metadata

Defined in:
lib/model_timeline.rb

.with_metadata(hash) { ... } ⇒ Object

Temporarily merges additional metadata for the duration of the block

Parameters:

  • hash (Hash)

    The metadata to merge with the current metadata

Yields:

  • The block to execute with the merged metadata

Returns:

  • (Object)

    Returns the result of the block



182
183
184
185
186
187
188
# File 'lib/model_timeline.rb', line 182

def (hash)
   = .dup
  self. = .merge(hash)
  yield
ensure
  self. = 
end