Class: DoSnapshot::Adapter::Abstract
- Inherits:
-
Object
- Object
- DoSnapshot::Adapter::Abstract
- Includes:
- Helpers
- Defined in:
- lib/do_snapshot/adapter/abstract.rb
Overview
API for CLI commands Operating with Digital Ocean.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#stop_by ⇒ Object
writeonly
Sets the attribute stop_by.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Abstract
constructor
A new instance of Abstract.
-
#start_droplet(id) ⇒ Object
Power On request for Droplet.
Methods included from Helpers
Constructor Details
#initialize(options = {}) ⇒ Abstract
Returns a new instance of Abstract.
15 16 17 18 19 20 21 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 15 def initialize( = {}) check_keys set_id .each_pair do |key, option| send("#{key}=", option) end end |
Instance Attribute Details
#delay ⇒ Object
Returns the value of attribute delay.
12 13 14 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 12 def delay @delay end |
#stop_by=(value) ⇒ Object
Sets the attribute stop_by
13 14 15 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 13 def stop_by=(value) @stop_by = value end |
#timeout ⇒ Object
Returns the value of attribute timeout.
12 13 14 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 12 def timeout @timeout end |
Instance Method Details
#start_droplet(id) ⇒ Object
Power On request for Droplet
25 26 27 28 29 30 31 32 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 25 def start_droplet(id) # noinspection RubyResolve instance = droplet(id) return power_on(id) if instance.respond_to?(:status) && !instance.status.include?('active') logger.error "Droplet #{id} is still running. Skipping." end |