Sha256: 9e08cb6a2682863dc82ca785a76f31bdbc1553ad53475dc961c36328a8333cee

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

require_relative '../value_equality'
require_relative 'change'

module RubyTerraform
  module Models
    class ResourceChange
      include ValueEquality

      def initialize(content)
        @content = content
      end

      def address
        @content[:address]
      end

      def module_address
        @content[:module_address]
      end

      def mode
        @content[:mode]
      end

      def type
        @content[:type]
      end

      def name
        @content[:name]
      end

      def index
        @content[:index]
      end

      def provider_name
        @content[:provider_name]
      end

      def change
        Change.new(@content[:change])
      end

      def no_op?
        change.no_op?
      end

      def create?
        change.create?
      end

      def read?
        change.read?
      end

      def update?
        change.update?
      end

      def replace_delete_before_create?
        change.replace_delete_before_create?
      end

      def replace_create_before_delete?
        change.replace_create_before_delete?
      end

      def replace?
        change.replace?
      end

      def delete?
        change.delete?
      end

      def inspect
        @content.inspect
      end

      def to_h
        @content
      end

      def state
        [@content]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-terraform-1.7.0.pre.12 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.11 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.10 lib/ruby_terraform/models/resource_change.rb