Class: ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Commands::SetFeatureStubbedEntry
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Feature::Plugins::CanHaveStubbedEntries::Commands::SetFeatureStubbedEntry
- Defined in:
- lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/set_feature_stubbed_entry.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#call ⇒ Object
Can be any type.
- #initialize(feature:, entry:, arguments:, value:) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(feature:, entry:, arguments:, value:) ⇒ void
45 46 47 48 49 50 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/set_feature_stubbed_entry.rb', line 45 def initialize(feature:, entry:, arguments:, value:) @feature = feature @entry = entry @arguments = arguments @value = value end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
30 31 32 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/set_feature_stubbed_entry.rb', line 30 def arguments @arguments end |
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
24 25 26 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/set_feature_stubbed_entry.rb', line 24 def entry @entry end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
18 19 20 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/set_feature_stubbed_entry.rb', line 18 def feature @feature end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
36 37 38 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/set_feature_stubbed_entry.rb', line 36 def value @value end |
Instance Method Details
#call ⇒ Object
Returns Can be any type.
58 59 60 61 62 63 64 |
# File 'lib/convenient_service/feature/plugins/can_have_stubbed_entries/commands/set_feature_stubbed_entry.rb', line 58 def call if arguments.nil? cache.default = value else cache.write(cache.keygen(*arguments.args, **arguments.kwargs, &arguments.block), value) end end |