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.
14 15 16 17 18 19 20 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 14 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.
11 12 13 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 11 def delay @delay end |
#stop_by=(value) ⇒ Object
Sets the attribute stop_by
12 13 14 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 12 def stop_by=(value) @stop_by = value end |
#timeout ⇒ Object
Returns the value of attribute timeout.
11 12 13 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 11 def timeout @timeout end |
Instance Method Details
#start_droplet(id) ⇒ Object
Power On request for Droplet
24 25 26 27 28 29 30 31 |
# File 'lib/do_snapshot/adapter/abstract.rb', line 24 def start_droplet(id) # noinspection RubyResolve instance = droplet(id) return power_on(id) unless instance.status.include?('active') logger.error "Droplet #{id} is still running. Skipping." end |