Class: Aliyun::Log::ScopeRegistry

Inherits:
Object
  • Object
show all
Extended by:
PerThreadRegistry
Defined in:
lib/aliyun/log/record/scope_registry.rb

Instance Method Summary collapse

Methods included from PerThreadRegistry

extended, instance

Constructor Details

#initializeScopeRegistry

Returns a new instance of ScopeRegistry.



26
27
28
# File 'lib/aliyun/log/record/scope_registry.rb', line 26

def initialize
  @registry = Hash.new { |hash, key| hash[key] = {} }
end

Instance Method Details

#set_value_for(scope_type, model, value) ⇒ Object

Sets the value for a given scope_type and model.



35
36
37
# File 'lib/aliyun/log/record/scope_registry.rb', line 35

def set_value_for(scope_type, model, value)
  @registry[scope_type][model.name] = value
end

#value_for(scope_type, model) ⇒ Object



30
31
32
# File 'lib/aliyun/log/record/scope_registry.rb', line 30

def value_for(scope_type, model)
  @registry[scope_type][model.name]
end