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
- #invalidate_target_methods ⇒ Object
- #invalidate_target_metrics ⇒ Object
- #option_target_system_name ⇒ Object
- #source_backend ⇒ Object
- #source_backend_ref ⇒ Object
- #source_hits ⇒ Object
- #source_methods ⇒ Object
- #source_metrics ⇒ Object
- #source_remote ⇒ Object
- #target_backend ⇒ Object
- #target_backend=(target) ⇒ Object
- #target_hits ⇒ Object
- #target_methods ⇒ Object
- #target_metrics ⇒ 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 |
#invalidate_target_methods ⇒ Object
53 54 55 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 53 def invalidate_target_methods context[:target_methods] = nil end |
#invalidate_target_metrics ⇒ Object
57 58 59 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 57 def invalidate_target_metrics context[:target_metrics] = nil end |
#option_target_system_name ⇒ Object
74 75 76 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 74 def option_target_system_name context[:option_target_system_name] 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
69 70 71 72 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 69 def source_backend_ref context[:source_backend_ref] ||= raise ThreeScaleToolbox::Error, 'Unexpected error. ' \ 'source_backend_ref not found' end |
#source_hits ⇒ Object
33 34 35 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 33 def source_hits context[:source_hits] ||= source_backend.hits end |
#source_methods ⇒ Object
29 30 31 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 29 def source_methods context[:source_methods] ||= source_backend.methods(source_hits) end |
#source_metrics ⇒ Object
37 38 39 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 37 def source_metrics context[:source_metrics] ||= source_backend.metrics end |
#source_remote ⇒ Object
61 62 63 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 61 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_hits ⇒ Object
45 46 47 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 45 def target_hits context[:target_hits] ||= target_backend.hits end |
#target_methods ⇒ Object
49 50 51 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 49 def target_methods context[:target_methods] ||= target_backend.methods(target_hits) end |
#target_metrics ⇒ Object
41 42 43 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 41 def target_metrics context[:target_metrics] ||= target_backend.metrics end |
#target_remote ⇒ Object
65 66 67 |
# File 'lib/3scale_toolbox/commands/backend_command/copy_command/task.rb', line 65 def target_remote context[:target_remote] end |