Class: ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Commands::DeleteFeatureStubbedEntry

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

Overview

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(feature:, entry:, arguments:) ⇒ void

Parameters:

Since:

  • 1.0.0



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

def initialize(feature:, entry:, arguments:)
  @feature = feature
  @entry = entry
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject (readonly)

Since:

  • 1.0.0



30
31
32
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/delete_feature_stubbed_entry.rb', line 30

def arguments
  @arguments
end

#entryObject (readonly)

Since:

  • 1.0.0



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

def entry
  @entry
end

#featureObject (readonly)

Since:

  • 1.0.0



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

def feature
  @feature
end

Instance Method Details

#callObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.

Since:

  • 1.0.0



50
51
52
53
54
55
56
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/delete_feature_stubbed_entry.rb', line 50

def call
  if arguments.nil?
    cache.default = nil
  else
    cache.delete(cache.keygen(*arguments.args, **arguments.kwargs, &arguments.block))
  end
end