Class: Terradactyl::Terraform::Rev012::PlanFileParser

Inherits:
Object
  • Object
show all
Defined in:
lib/terradactyl/terraform/planfile.rb

Constant Summary collapse

PLAN_FILE_SIGNATURE =
'Terraform will perform the following actions'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plan_path) ⇒ PlanFileParser

Returns a new instance of PlanFileParser.



17
18
19
# File 'lib/terradactyl/terraform/planfile.rb', line 17

def initialize(plan_path)
  @plan_path = plan_path
end

Instance Attribute Details

#plan_pathObject (readonly)

Returns the value of attribute plan_path.



9
10
11
# File 'lib/terradactyl/terraform/planfile.rb', line 9

def plan_path
  @plan_path
end

Class Method Details

.load(plan_path) ⇒ Object



13
14
15
# File 'lib/terradactyl/terraform/planfile.rb', line 13

def self.load(plan_path)
  new(plan_path)
end

Instance Method Details

#checksumObject



21
22
23
# File 'lib/terradactyl/terraform/planfile.rb', line 21

def checksum
  Digest::SHA1.hexdigest(data)
end

#dataObject



25
26
27
# File 'lib/terradactyl/terraform/planfile.rb', line 25

def data
  @data ||= parse(@plan_path)
end

#signatureObject



29
30
31
# File 'lib/terradactyl/terraform/planfile.rb', line 29

def signature
  self.class::PLAN_FILE_SIGNATURE
end