Module: Logidze::Meta

Included in:
Logidze
Defined in:
lib/logidze/meta.rb

Overview

Provide methods to attach meta information

Instance Method Summary collapse

Instance Method Details

#with_meta(meta, transactional: true, &block) ⇒ Object



6
7
8
9
# File 'lib/logidze/meta.rb', line 6

def with_meta(meta, transactional: true, &block)
  wrapper = transactional ? MetaWithTransaction : MetaWithoutTransaction
  wrapper.wrap_with(meta, &block)
end

#with_responsible(responsible_id, transactional: true, &block) ⇒ Object



11
12
13
14
15
16
# File 'lib/logidze/meta.rb', line 11

def with_responsible(responsible_id, transactional: true, &block)
  return yield if responsible_id.nil?

  meta = {Logidze::History::Version::META_RESPONSIBLE => responsible_id}
  with_meta(meta, transactional: transactional, &block)
end