Class: ReportsMash::Engine::ThreadState

Inherits:
Object
  • Object
show all
Defined in:
lib/reportsmash/engine/thread_state.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeThreadState

Returns a new instance of ThreadState.



5
6
7
# File 'lib/reportsmash/engine/thread_state.rb', line 5

def initialize
  @transaction = nil
end

Instance Attribute Details

#transactionObject

Returns the value of attribute transaction.



4
5
6
# File 'lib/reportsmash/engine/thread_state.rb', line 4

def transaction
  @transaction
end

Class Method Details

.clearObject



13
14
15
# File 'lib/reportsmash/engine/thread_state.rb', line 13

def self.clear
  Thread.current[:reportsmash_state] = nil
end

.get_current_stateObject



9
10
11
# File 'lib/reportsmash/engine/thread_state.rb', line 9

def self.get_current_state
  Thread.current[:reportsmash_state] ||= ThreadState.new
end