debian-mirror-gitlab/lib/gitlab/null_request_store.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
597 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
# Used by Gitlab::SafeRequestStore
module Gitlab
# The methods `begin!`, `clear!`, and `end!` are not defined because they
# should only be called directly on `RequestStore`.
class NullRequestStore
def store
{}
end
def active?
end
def read(key)
end
def [](key)
end
def write(key, value)
value
end
def []=(key, value)
value
end
def exist?(key)
false
end
def fetch(key, &block)
yield
end
def delete(key, &block)
2022-08-27 11:52:29 +05:30
yield(key) if block
2018-12-05 23:21:45 +05:30
end
end
end