Method: Schemacop.with_context

Defined in:
lib/schemacop.rb

.with_context(context) ⇒ Object



100
101
102
103
104
105
106
# File 'lib/schemacop.rb', line 100

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