Class: CloudProviders::CloudProvider
- Inherits:
-
Object
- Object
- CloudProviders::CloudProvider
show all
- Includes:
- Dslify
- Defined in:
- lib/cloud_providers/cloud_provider.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(name, init_opts = {}, &block) ⇒ CloudProvider
Returns a new instance of CloudProvider.
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/cloud_providers/cloud_provider.rb', line 16
def initialize(name, init_opts={}, &block)
@name = name
if name.is_a?(Hash) && init_opts.empty?
@init_opts = name
else
@init_opts = init_opts
end
set_vars_from_options(init_opts)
instance_eval &block if block
after_initialized
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *a, &block) ⇒ Object
46
47
48
49
50
51
52
|
# File 'lib/cloud_providers/cloud_provider.rb', line 46
def method_missing(m,*a,&block)
if cloud && cloud.respond_to?(m)
cloud.send(m,*a,&block)
else
super
end
end
|
Instance Attribute Details
#init_opts ⇒ Object
Returns the value of attribute init_opts.
14
15
16
|
# File 'lib/cloud_providers/cloud_provider.rb', line 14
def init_opts
@init_opts
end
|
Returns the value of attribute name.
14
15
16
|
# File 'lib/cloud_providers/cloud_provider.rb', line 14
def name
@name
end
|
Class Method Details
.default_keypair_path ⇒ Object
39
40
41
|
# File 'lib/cloud_providers/cloud_provider.rb', line 39
def self.default_keypair_path
ENV["EC2_CONFIG_DIR"] || "#{ENV["HOME"]}/.ssh"
end
|
Instance Method Details
#after_initialized ⇒ Object
28
29
|
# File 'lib/cloud_providers/cloud_provider.rb', line 28
def after_initialized
end
|
#bootstrap_nodes! ⇒ Object
43
44
|
# File 'lib/cloud_providers/cloud_provider.rb', line 43
def bootstrap_nodes!
end
|
#default_keypair_path ⇒ Object
35
36
37
|
# File 'lib/cloud_providers/cloud_provider.rb', line 35
def default_keypair_path
self.class.default_keypair_path
end
|
31
32
33
|
# File 'lib/cloud_providers/cloud_provider.rb', line 31
def run
warn "#{self.class} does not implement run. Something is wrong"
end
|