Class: Spyke::ScopeRegistry
- Inherits:
-
Object
- Object
- Spyke::ScopeRegistry
- Extended by:
- ActiveSupport::PerThreadRegistry
- Defined in:
- lib/spyke/scope_registry.rb
Instance Method Summary collapse
-
#initialize ⇒ ScopeRegistry
constructor
A new instance of ScopeRegistry.
- #set_value_for(scope_type, variable_name, value) ⇒ Object
- #value_for(scope_type, variable_name) ⇒ Object
Constructor Details
#initialize ⇒ ScopeRegistry
Returns a new instance of ScopeRegistry.
5 6 7 |
# File 'lib/spyke/scope_registry.rb', line 5 def initialize @registry = Hash.new { |hash, key| hash[key] = {} } end |
Instance Method Details
#set_value_for(scope_type, variable_name, value) ⇒ Object
13 14 15 |
# File 'lib/spyke/scope_registry.rb', line 13 def set_value_for(scope_type, variable_name, value) @registry[scope_type][variable_name] = value end |
#value_for(scope_type, variable_name) ⇒ Object
9 10 11 |
# File 'lib/spyke/scope_registry.rb', line 9 def value_for(scope_type, variable_name) @registry[scope_type][variable_name] end |