Module: DataMapper::YS::CachedAccessor

Included in:
Scraper::Base
Defined in:
lib/dm-ys/cached_accessor.rb

Overview

CachedAccessor

Defined Under Namespace

Classes: Define

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/dm-ys/cached_accessor.rb', line 7

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