Class: Cody::Stack
- Inherits:
-
Object
- Object
- Cody::Stack
- Includes:
- AwsServices
- Defined in:
- lib/cody/stack.rb,
lib/cody/stack/base.rb,
lib/cody/stack/create.rb,
lib/cody/stack/update.rb
Defined Under Namespace
Instance Method Summary collapse
-
#initialize(options) ⇒ Stack
constructor
A new instance of Stack.
- #run ⇒ Object
Methods included from AwsServices
Methods included from AwsServices::Helpers
#are_you_sure?, #find_stack, #inferred_project_name, #inferred_stack_name, #normalize_stack_name, #project_name_convention, #stack_exists?
Constructor Details
#initialize(options) ⇒ Stack
Returns a new instance of Stack.
7 8 9 10 11 |
# File 'lib/cody/stack.rb', line 7 def initialize() = @project_name = [:project_name] || inferred_project_name @stack_name = normalize_stack_name([:stack_name] || inferred_stack_name(@project_name)) end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/cody/stack.rb', line 13 def run handle_rollback_completed! if stack_exists?(@stack_name) Update.new().run else Create.new().run end end |