Sha256: f29877f4d81b7d04b0650ae7d54624c2cd949b4c4c10821b6cf001c7796a47ce

Contents?: true

Size: 280 Bytes

Versions: 10

Compression:

Stored size: 280 Bytes

Contents

require 'request_store'

module Thoth
  module Context

    KEY = :thoth_context

    def context
      RequestStore.store[KEY] ||= {}
    end

    def context=(value)
      RequestStore.store[KEY] = value
    end

    def clear_context!
      self.context = {}
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
thoth-3.0.0 lib/thoth/context.rb
thoth-2.0.0 lib/thoth/context.rb
thoth-1.0.2 lib/thoth/context.rb
thoth-1.0.1 lib/thoth/context.rb
thoth-1.0.0 lib/thoth/context.rb
thoth-0.0.7 lib/thoth/context.rb
thoth-0.0.6 lib/thoth/context.rb
thoth-0.0.5 lib/thoth/context.rb
thoth-0.0.3 lib/thoth/context.rb
thoth-0.0.2 lib/thoth/context.rb