class Prawn::ThreadLocalCache

Public Class Methods

new() click to toggle source
# File lib/prawn/utilities.rb, line 33
def initialize
  @cache_id = "cache_#{self.object_id}".to_sym
end

Public Instance Methods

[](key) click to toggle source
# File lib/prawn/utilities.rb, line 36
def [](key)
  (Thread.current[@cache_id] ||= {})[key]
end
[]=(key,value) click to toggle source
# File lib/prawn/utilities.rb, line 39
def []=(key,value)
  (Thread.current[@cache_id] ||= {})[key] = value
end