Module: Contextuality

Defined in:
lib/contextuality.rb,
lib/contextuality/context.rb,
lib/contextuality/version.rb,
lib/contextuality/defaults.rb

Defined Under Namespace

Modules: ContextualityMethods, ObjectMethods, ThreadMethods Classes: Context, Defaults

Constant Summary collapse

VERSION =
"1.0.4"

Class Method Summary collapse

Class Method Details

.defaultsObject



17
18
19
# File 'lib/contextuality.rb', line 17

def self.defaults
  ::Thread.main[:contextuality_defaults] ||= Contextuality::Defaults.new
end

.included(klass) ⇒ Object



6
7
8
9
10
11
# File 'lib/contextuality.rb', line 6

def self.included klass
  klass.class_eval do
    extend ContextualityMethods
    include ContextualityMethods
  end
end

.log(message) ⇒ Object



25
26
27
# File 'lib/contextuality.rb', line 25

def self.log message
  @logger.info message if @logger
end

.logger=(logger) ⇒ Object



21
22
23
# File 'lib/contextuality.rb', line 21

def self.logger= logger
  @logger = logger
end

.method_missing(method, *args, &block) ⇒ Object



13
14
15
# File 'lib/contextuality.rb', line 13

def self.method_missing method, *args, &block
  ::Thread.current.contextuality[method]
end