Class: ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::DestroyMappingRulesTask
- Inherits:
-
Object
- Object
- ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::DestroyMappingRulesTask
- Defined in:
- lib/3scale_toolbox/commands/service_command/copy_command/destroy_mapping_rules_task.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(context) ⇒ DestroyMappingRulesTask
constructor
A new instance of DestroyMappingRulesTask.
Constructor Details
#initialize(context) ⇒ DestroyMappingRulesTask
Returns a new instance of DestroyMappingRulesTask.
8 9 10 |
# File 'lib/3scale_toolbox/commands/service_command/copy_command/destroy_mapping_rules_task.rb', line 8 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/3scale_toolbox/commands/service_command/copy_command/destroy_mapping_rules_task.rb', line 6 def context @context end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/3scale_toolbox/commands/service_command/copy_command/destroy_mapping_rules_task.rb', line 12 def call return unless delete_mapping_rules puts 'destroying all mapping rules' target.mapping_rules.each do |mapping_rule| target.delete_mapping_rule mapping_rule['id'] end end |