Sha256: 232b124a6526c2899a23d779858488a9abeb0447169898a1320331cfb48c6ccd

Contents?: true

Size: 543 Bytes

Versions: 12

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

module OperatorRecordable
  class CurrentAttributesStore
    class Current < ::ActiveSupport::CurrentAttributes
      attribute :store

      def [](key)
        return nil unless self.store

        self.store[key]
      end

      def []=(key, value)
        self.store ||= {}
        self.store[key] = value
      end
    end

    def [](key)
      Current[key]
    end

    def []=(key, value)
      Current[key] = value
    end
  end

  Store.register(:current_attributes_store, CurrentAttributesStore)
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
operator_recordable-2.0.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-1.4.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-1.3.1 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-1.3.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-1.2.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-1.1.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-1.0.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-0.4.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-0.3.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-0.2.0 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-0.1.1 lib/operator_recordable/store/current_attributes_store.rb
operator_recordable-0.1.0 lib/operator_recordable/store/current_attributes_store.rb