Class: ThreeScaleToolbox::Commands::UpdateCommand::ServiceCommand::DeleteActiveDocsTask

Inherits:
Object
  • Object
show all
Defined in:
lib/3scale_toolbox/commands/update_command/service_command/delete_activedocs_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ DeleteActiveDocsTask

Returns a new instance of DeleteActiveDocsTask.



8
9
10
# File 'lib/3scale_toolbox/commands/update_command/service_command/delete_activedocs_task.rb', line 8

def initialize(context)
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



6
7
8
# File 'lib/3scale_toolbox/commands/update_command/service_command/delete_activedocs_task.rb', line 6

def context
  @context
end

Instance Method Details

#callObject



12
13
14
15
16
17
# File 'lib/3scale_toolbox/commands/update_command/service_command/delete_activedocs_task.rb', line 12

def call
  puts 'deleting all target service ActiveDocs'
  target.activedocs.each do |activedoc|
    target.remote.delete_activedocs(activedoc['id'])
  end
end

#targetObject



19
20
21
# File 'lib/3scale_toolbox/commands/update_command/service_command/delete_activedocs_task.rb', line 19

def target
  context[:target]
end