Module: LogWeasel::Transaction

Defined in:
lib/log_weasel/transaction.rb

Class Method Summary collapse

Class Method Details

.create(key = nil) ⇒ Object



6
7
8
# File 'lib/log_weasel/transaction.rb', line 6

def self.create(key = nil)
  Thread.current[:log_weasel_id] = "#{key ? "#{key}-" : ""}#{SecureRandom.hex(10)}"
end

.destroyObject



10
11
12
# File 'lib/log_weasel/transaction.rb', line 10

def self.destroy
  Thread.current[:log_weasel_id] = nil
end

.idObject



18
19
20
# File 'lib/log_weasel/transaction.rb', line 18

def self.id
  Thread.current[:log_weasel_id]
end

.id=(id) ⇒ Object



14
15
16
# File 'lib/log_weasel/transaction.rb', line 14

def self.id=(id)
  Thread.current[:log_weasel_id] = id
end