Module: Doodle::ClassMethods

Included in:
Doodle
Defined in:
lib/doodle/core.rb

Instance Method Summary collapse

Instance Method Details

#contextObject

provide somewhere to hold thread-specific context information (I’m claiming the :doodle_xxx namespace)



5
6
7
# File 'lib/doodle/core.rb', line 5

def context
  Thread.current[:doodle_context] ||= []
end

#parentObject



8
9
10
# File 'lib/doodle/core.rb', line 8

def parent
  context[-1]
end