Class: RubyTerraform::Models::OutputChange

Inherits:
Object
  • Object
show all
Includes:
ValueEquality
Defined in:
lib/ruby_terraform/models/output_change.rb

Instance Method Summary collapse

Methods included from ValueEquality

#==, #hash

Constructor Details

#initialize(name, content) ⇒ OutputChange

Returns a new instance of OutputChange.



11
12
13
14
# File 'lib/ruby_terraform/models/output_change.rb', line 11

def initialize(name, content)
  @name = name.to_sym
  @content = symbolise_keys(content)
end

Instance Method Details

#changeObject



20
21
22
# File 'lib/ruby_terraform/models/output_change.rb', line 20

def change
  Change.new(@content)
end

#create?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ruby_terraform/models/output_change.rb', line 28

def create?
  change.create?
end

#delete?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ruby_terraform/models/output_change.rb', line 36

def delete?
  change.delete?
end

#inspectObject



48
49
50
# File 'lib/ruby_terraform/models/output_change.rb', line 48

def inspect
  to_h.inspect
end

#nameObject



16
17
18
# File 'lib/ruby_terraform/models/output_change.rb', line 16

def name
  @name.to_s
end

#no_op?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/ruby_terraform/models/output_change.rb', line 24

def no_op?
  change.no_op?
end

#present_after?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/ruby_terraform/models/output_change.rb', line 44

def present_after?
  no_op? || create? || update?
end

#present_before?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/ruby_terraform/models/output_change.rb', line 40

def present_before?
  no_op? || update? || delete?
end

#stateObject



56
57
58
# File 'lib/ruby_terraform/models/output_change.rb', line 56

def state
  [@name, @content]
end

#to_hObject



52
53
54
# File 'lib/ruby_terraform/models/output_change.rb', line 52

def to_h
  { @name => @content }
end

#update?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/ruby_terraform/models/output_change.rb', line 32

def update?
  change.update?
end