Class: RSpec::Core::MemoizedHelpers::NonThreadSafeMemoized
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/memoized_helpers.rb
Instance Method Summary collapse
- #fetch_or_store(key) ⇒ Object
-
#initialize ⇒ NonThreadSafeMemoized
constructor
A new instance of NonThreadSafeMemoized.
Constructor Details
#initialize ⇒ NonThreadSafeMemoized
Returns a new instance of NonThreadSafeMemoized.
187 188 189 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/memoized_helpers.rb', line 187 def initialize @memoized = {} end |
Instance Method Details
#fetch_or_store(key) ⇒ Object
191 192 193 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/memoized_helpers.rb', line 191 def fetch_or_store(key) @memoized.fetch(key) { @memoized[key] = yield } end |