Module: ThreeScaleToolbox::Commands::BackendCommand::CopyCommand::Task
- Included in:
- CopyMappingRulesTask, CopyMethodsTask, CopyMetricsTask, CreateOrUpdateTargetBackendTask
- Defined in:
- lib/3scale_toolbox/commands/backend_command/copy_command/task.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #call ⇒ Object
- #initialize(context) ⇒ Object
- #logger ⇒ Object
- #option_target_system_name ⇒ Object
- #report ⇒ Object
- #source_backend ⇒ Object
- #source_backend_ref ⇒ Object
- #source_remote ⇒ Object
- #target_backend ⇒ Object
- #target_backend=(target) ⇒ Object
- #target_remote ⇒ Object
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 6 def context @context end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 12 def call run end |
#initialize(context) ⇒ Object
8 9 10 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 8 def initialize(context) @context = context end |
#logger ⇒ Object
46 47 48 49 50 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 46 def logger context[:logger] ||= Logger.new($stdout).tap do |logger| logger.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n" } end end |
#option_target_system_name ⇒ Object
42 43 44 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 42 def option_target_system_name context[:option_target_system_name] end |
#report ⇒ Object
52 53 54 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 52 def report context[:report] ||= {} end |
#source_backend ⇒ Object
25 26 27 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 25 def source_backend context[:source_backend] ||= find_source_backend end |
#source_backend_ref ⇒ Object
37 38 39 40 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 37 def source_backend_ref context[:source_backend_ref] ||= raise ThreeScaleToolbox::Error, 'Unexpected error. ' \ 'source_backend_ref not found' end |
#source_remote ⇒ Object
29 30 31 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 29 def source_remote context[:source_remote] end |
#target_backend ⇒ Object
20 21 22 23 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 20 def target_backend context[:target_backend] ||= raise ThreeScaleToolbox::Error, 'Unexpected error. ' \ 'Target backend should have been created or updated' end |
#target_backend=(target) ⇒ Object
16 17 18 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 16 def target_backend=(target) context[:target_backend] = target end |
#target_remote ⇒ Object
33 34 35 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 33 def target_remote context[:target_remote] end |