module Schemacop
Schemacop
module
Constants
- CONTEXT_THREAD_KEY
Public Class Methods
context()
click to toggle source
# File lib/schemacop.rb, line 24 def self.context Thread.current[CONTEXT_THREAD_KEY] ||= V3::Context.new end
with_context(context) { || ... }
click to toggle source
# File lib/schemacop.rb, line 16 def self.with_context(context) prev_context = Thread.current[CONTEXT_THREAD_KEY] Thread.current[CONTEXT_THREAD_KEY] = context return yield ensure Thread.current[CONTEXT_THREAD_KEY] = prev_context end