Class: Awshark::CloudFormation::Inferrer
- Inherits:
-
Object
- Object
- Awshark::CloudFormation::Inferrer
- Defined in:
- lib/awshark/cloud_formation/inferrer.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#stage ⇒ Object
readonly
Returns the value of attribute stage.
Instance Method Summary collapse
-
#initialize(path, stage = nil) ⇒ Inferrer
constructor
A new instance of Inferrer.
- #stack_name ⇒ Object
Constructor Details
#initialize(path, stage = nil) ⇒ Inferrer
Returns a new instance of Inferrer.
11 12 13 14 |
# File 'lib/awshark/cloud_formation/inferrer.rb', line 11 def initialize(path, stage = nil) @path = path @stage = stage end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/awshark/cloud_formation/inferrer.rb', line 9 def path @path end |
#stage ⇒ Object (readonly)
Returns the value of attribute stage.
9 10 11 |
# File 'lib/awshark/cloud_formation/inferrer.rb', line 9 def stage @stage end |
Instance Method Details
#stack_name ⇒ Object
16 17 18 19 20 21 |
# File 'lib/awshark/cloud_formation/inferrer.rb', line 16 def stack_name file_extension = File.extname(path) name = File.basename(path, file_extension) [name, stage].compact.join('-').gsub('_', '-') end |