Class: Spyke::ScopeRegistry

Inherits:
Object
  • Object
show all
Extended by:
ActiveSupport::PerThreadRegistry
Defined in:
lib/spyke/scope_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScopeRegistry

Returns a new instance of ScopeRegistry.



16
17
18
# File 'lib/spyke/scope_registry.rb', line 16

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

Instance Attribute Details

#registryObject

Returns the value of attribute registry.



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

def registry
  @registry
end

Instance Method Details

#set_value_for(scope_type, variable_name, value) ⇒ Object



24
25
26
# File 'lib/spyke/scope_registry.rb', line 24

def set_value_for(scope_type, variable_name, value)
  registry[scope_type][variable_name] = value
end

#value_for(scope_type, variable_name) ⇒ Object



20
21
22
# File 'lib/spyke/scope_registry.rb', line 20

def value_for(scope_type, variable_name)
  registry[scope_type][variable_name]
end