module Temple::Mixins::ThreadOptions

Public Instance Methods

thread_options() click to toggle source
# File lib/temple/mixins/options.rb, line 58
def thread_options
  Thread.current[thread_options_key]
end
with_options(options) { || ... } click to toggle source
# File lib/temple/mixins/options.rb, line 50
def with_options(options)
  old_options = thread_options
  Thread.current[thread_options_key] = ImmutableMap.new(options, thread_options)
  yield
ensure
  Thread.current[thread_options_key] = old_options
end

Protected Instance Methods

thread_options_key() click to toggle source
# File lib/temple/mixins/options.rb, line 64
def thread_options_key
  @thread_options_key ||= "#{self.name}-thread-options".to_sym
end