Class: Cloudspin::Stack::Definition
- Inherits:
-
Object
- Object
- Cloudspin::Stack::Definition
- Defined in:
- lib/cloudspin/stack/definition.rb
Instance Attribute Summary collapse
-
#parameter_names ⇒ Object
readonly
Returns the value of attribute parameter_names.
-
#resource_names ⇒ Object
readonly
Returns the value of attribute resource_names.
-
#terraform_source_path ⇒ Object
readonly
Returns the value of attribute terraform_source_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(terraform_source_path: '', parameter_names: [], resource_names: []) ⇒ Definition
constructor
A new instance of Definition.
Constructor Details
#initialize(terraform_source_path: '', parameter_names: [], resource_names: []) ⇒ Definition
Returns a new instance of Definition.
9 10 11 12 13 14 15 |
# File 'lib/cloudspin/stack/definition.rb', line 9 def initialize(terraform_source_path: '', parameter_names: [], resource_names: []) @terraform_source_path = terraform_source_path @parameter_names = parameter_names @resource_names = resource_names end |
Instance Attribute Details
#parameter_names ⇒ Object (readonly)
Returns the value of attribute parameter_names.
7 8 9 |
# File 'lib/cloudspin/stack/definition.rb', line 7 def parameter_names @parameter_names end |
#resource_names ⇒ Object (readonly)
Returns the value of attribute resource_names.
7 8 9 |
# File 'lib/cloudspin/stack/definition.rb', line 7 def resource_names @resource_names end |
#terraform_source_path ⇒ Object (readonly)
Returns the value of attribute terraform_source_path.
7 8 9 |
# File 'lib/cloudspin/stack/definition.rb', line 7 def terraform_source_path @terraform_source_path end |
Class Method Details
.from_file(specfile) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/cloudspin/stack/definition.rb', line 17 def self.from_file(specfile) raise "Cloudspin definition file not found: #{specfile}" unless File.exists?(specfile) spec_hash = YAML.load_file(specfile) stack_spec = symbolize(spec_hash) terraform_source_path = File.dirname(specfile) self.new(terraform_source_path: terraform_source_path, **stack_spec) end |