Module: CachedAccessor

Defined in:
lib/pic2ch/cached_accessor.rb

Overview

CachedAccessor

Defined Under Namespace

Classes: Define

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/pic2ch/cached_accessor.rb', line 5

def self.included(klass)
  def klass.cached_accessor(&block)
    Thread.current[:cached_accessor] = true
    Define.new(self, &block)
  ensure
    Thread.current[:cached_accessor] = false
  end
  super
end