Class: Awshark::CloudFormation::Inferrer

Inherits:
Object
  • Object
show all
Defined in:
lib/awshark/cloud_formation/inferrer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/awshark/cloud_formation/inferrer.rb', line 9

def path
  @path
end

#stageObject (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_nameObject



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