Class: Lore::Context
Constant Summary collapse
- @@context_stack =
Array.new
Class Method Summary collapse
- .enter(context_name) ⇒ Object
- .get_connection ⇒ Object
- .get_context ⇒ Object
- .inspect ⇒ Object
- .leave ⇒ Object
Class Method Details
.enter(context_name) ⇒ Object
29 30 31 32 |
# File 'lib/lore/adapters/context.rb', line 29 def self.enter(context_name) Lore.logger.debug { "Entering context #{context_name}" } @@context_stack.push(context_name.to_sym) end |
.get_connection ⇒ Object
14 15 16 17 18 19 |
# File 'lib/lore/adapters/context.rb', line 14 def self.get_connection() if @@context_stack.empty? then raise ::Exception.new('No context given. ') end return Connection_Pool.get_connection(@@context_stack.last) end |
.get_context ⇒ Object
21 22 23 |
# File 'lib/lore/adapters/context.rb', line 21 def self.get_context @@context_stack.last end |
.inspect ⇒ Object
25 26 27 |
# File 'lib/lore/adapters/context.rb', line 25 def self.inspect @@context_stack.inspect end |