Sha256: 75e8beb346bfe81f92fa8c986a1470fae76a8b206dccb86b2166d18802b8ef82
Contents?: true
Size: 336 Bytes
Versions: 2
Compression:
Stored size: 336 Bytes
Contents
class Thread def self.currently(key, value=true) __currently_org__, Thread.current[key] = Thread.current[key], value yield if block_given? ensure Thread.current[key] = __currently_org__ end def self.currently?(key, value=true) if Thread.current[key] == value block_given? ? yield : true end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
active_record-mti-0.4.0.pre.2 | lib/core_ext/thread.rb |
active_record-mti-0.4.0.pre.1 | lib/core_ext/thread.rb |