Sha256: d9c76161c50c9ed3121b24c7d06bcbdd54e0106fcbc9cd893b0d822bd9ab3e35

Contents?: true

Size: 821 Bytes

Versions: 1

Compression:

Stored size: 821 Bytes

Contents

# frozen_string_literal: true

require_relative '../value_equality'
require_relative 'change'

module RubyTerraform
  module Models
    class OutputChange
      include ValueEquality

      attr_reader(:name)

      def initialize(name, content)
        @name = name
        @content = content
      end

      def change
        Change.new(@content)
      end

      def create?
        change.create?
      end

      def update?
        change.update?
      end

      def delete?
        change.delete?
      end

      def present_before?
        update? || delete?
      end

      def present_after?
        create? || update?
      end

      def inspect
        to_h.inspect
      end

      def to_h
        { @name => @content }
      end

      def state
        [@name, @content]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-terraform-1.7.0.pre.11 lib/ruby_terraform/models/output_change.rb