Class: ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Commands::FetchAllFeaturesStubbedEntriesCache

Inherits:
Support::Command
  • Object
show all
Defined in:
lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/fetch_all_features_stubbed_entries_cache.rb

Overview

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(feature:) ⇒ void

Parameters:

Since:

  • 1.0.0



24
25
26
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/fetch_all_features_stubbed_entries_cache.rb', line 24

def initialize(feature:)
  @feature = feature
end

Instance Attribute Details

#featureObject (readonly)

Since:

  • 1.0.0



18
19
20
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/fetch_all_features_stubbed_entries_cache.rb', line 18

def feature
  @feature
end

Instance Method Details

#callConvenientService::Support::Cache

Returns:

Since:

  • 1.0.0



37
38
39
40
41
42
43
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/fetch_all_features_stubbed_entries_cache.rb', line 37

def call
  if feature.stubbed_entries_store
    Utils::Object.memoize_including_falsy_values(feature.stubbed_entries_store, :@__convenient_service_stubbed_entries__) { Support::Cache.backed_by(:thread_safe_hash).new }
  else
    Support::Cache.backed_by(:thread_safe_hash).new
  end
end