Sha256: eb83d06746bc5ba4655e87a103865866f8510e4f528d262b7b39ec65836adc13

Contents?: true

Size: 1.34 KB

Versions: 9

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

9 entries across 9 versions & 1 rubygems

Version Path
ruby-terraform-1.7.0.pre.9 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.8 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.7 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.6 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.5 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.4 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.3 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.2 lib/ruby_terraform/models/resource_change.rb
ruby-terraform-1.7.0.pre.1 lib/ruby_terraform/models/resource_change.rb