Class: ThreeScaleToolbox::Commands::ProductCommand::CopyCommand::CopyBackendsTask

Inherits:
Object
  • Object
show all
Defined in:
lib/3scale_toolbox/commands/product_command/copy_command/copy_backends_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ CopyBackendsTask

Returns a new instance of CopyBackendsTask.



8
9
10
# File 'lib/3scale_toolbox/commands/product_command/copy_command/copy_backends_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/product_command/copy_command/copy_backends_task.rb', line 6

def context
  @context
end

Instance Method Details

#callObject

entrypoint



13
14
15
16
17
# File 'lib/3scale_toolbox/commands/product_command/copy_command/copy_backends_task.rb', line 13

def call
  backend_list = source.backend_usage_list
  backend_list.each(&method(:create_backend))
  puts "created/upated #{backend_list.size} backends"
end