Class: Tablesalt::ThreadAccessor::ScopedAccessor
- Inherits:
-
Module
- Object
- Module
- Tablesalt::ThreadAccessor::ScopedAccessor
- Defined in:
- lib/tablesalt/thread_accessor/scoped_accessor.rb
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(scope) ⇒ ScopedAccessor
constructor
A new instance of ScopedAccessor.
- #inspect ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(scope) ⇒ ScopedAccessor
Returns a new instance of ScopedAccessor.
8 9 10 11 12 13 14 15 16 |
# File 'lib/tablesalt/thread_accessor/scoped_accessor.rb', line 8 def initialize(scope) @scope = scope extend ActiveSupport::Concern extend Management include ThreadAccessor const_set :THREAD_ACCESSOR_STORE_NAMESPACE, scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
6 7 8 |
# File 'lib/tablesalt/thread_accessor/scoped_accessor.rb', line 6 def scope @scope end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/tablesalt/thread_accessor/scoped_accessor.rb', line 22 def inspect "#<#{name}>" end |
#name ⇒ Object
18 19 20 |
# File 'lib/tablesalt/thread_accessor/scoped_accessor.rb', line 18 def name "#{self.class}:#{scope}" end |