Class: ActiveUsage::Tags
- Inherits:
-
Object
- Object
- ActiveUsage::Tags
- Defined in:
- lib/active_usage/tags.rb
Constant Summary collapse
- KEY =
:activeusage_tags
Instance Method Summary collapse
- #current ⇒ Object
- #flush ⇒ Object
-
#initialize(tags) ⇒ Tags
constructor
A new instance of Tags.
- #tag(**tags) ⇒ Object
Constructor Details
#initialize(tags) ⇒ Tags
Returns a new instance of Tags.
7 8 9 |
# File 'lib/active_usage/tags.rb', line 7 def initialize() @tags = end |
Instance Method Details
#current ⇒ Object
15 16 17 |
# File 'lib/active_usage/tags.rb', line 15 def current ActiveSupport::IsolatedExecutionState[KEY] || @tags end |
#flush ⇒ Object
19 20 21 |
# File 'lib/active_usage/tags.rb', line 19 def flush ActiveSupport::IsolatedExecutionState[KEY] = @tags end |
#tag(**tags) ⇒ Object
11 12 13 |
# File 'lib/active_usage/tags.rb', line 11 def tag(**) ActiveSupport::IsolatedExecutionState[KEY] = current.merge() end |