Class: Bosh::Cli::DeploymentManifestCompiler
- Defined in:
- lib/cli/deployment_manifest_compiler.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
-
#initialize(raw_manifest) ⇒ DeploymentManifestCompiler
constructor
A new instance of DeploymentManifestCompiler.
- #property(name) ⇒ Object
- #result ⇒ Object
Constructor Details
#initialize(raw_manifest) ⇒ DeploymentManifestCompiler
Returns a new instance of DeploymentManifestCompiler.
7 8 9 10 |
# File 'lib/cli/deployment_manifest_compiler.rb', line 7 def initialize(raw_manifest) @raw_manifest = raw_manifest @properties = {} end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
5 6 7 |
# File 'lib/cli/deployment_manifest_compiler.rb', line 5 def properties @properties end |
Instance Method Details
#property(name) ⇒ Object
12 13 14 15 |
# File 'lib/cli/deployment_manifest_compiler.rb', line 12 def property(name) @properties[name] || raise(UndefinedProperty, "Cannot resolve deployment property '#{name}'") end |
#result ⇒ Object
17 18 19 20 21 22 |
# File 'lib/cli/deployment_manifest_compiler.rb', line 17 def result ERB.new(@raw_manifest).result(binding.taint) rescue SyntaxError => e raise MalformedManifest, "Deployment manifest contains a syntax error\n" + e.to_s end |