Class: Ufo::Base
- Inherits:
-
Object
- Object
- Ufo::Base
- Extended by:
- Memoist
- Includes:
- Stack::Helper
- Defined in:
- lib/ufo/base.rb
Direct Known Subclasses
Cancel, Destroy, Info, Ps, Releases, Rollback, Scale, Ship, Status, Stop, Task
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(service, options = {}) ⇒ Base
constructor
A new instance of Base.
- #no_service_message ⇒ Object
- #switch_current(service) ⇒ Object
Methods included from Stack::Helper
#adjust_stack_name, #find_stack, #status
Methods included from Util
#default_cluster, #display_params, #execute, #pretty_time, #settings, #task_definition_arns, #user_params
Methods included from AwsService
#cloudformation, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb
Constructor Details
#initialize(service, options = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 13 |
# File 'lib/ufo/base.rb', line 6 def initialize(service, ={}) @service = switch_current(service) = @pretty_service_name = Ufo.pretty_service_name(@service) @cluster = [:cluster] || default_cluster @stack_name = adjust_stack_name(@cluster, @service) end |
Instance Method Details
#info ⇒ Object
19 20 21 |
# File 'lib/ufo/base.rb', line 19 def info Info.new(@service, ) end |
#no_service_message ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/ufo/base.rb', line 24 def "No \#{@pretty_service_name.color(:green)} found.\nNo CloudFormation stack named \#{@stack_name} found.\nAre sure it exists?\n EOL\nend\n" |
#switch_current(service) ⇒ Object
15 16 17 |
# File 'lib/ufo/base.rb', line 15 def switch_current(service) Current.service!(service) end |