Class: Retab::DeclarativePlanResourceChange

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_specs/declarative_plan_resource_change.rb

Constant Summary collapse

HASH_ATTRS =
{
  address: :address,
  target: :target,
  target_id: :target_id,
  name: :name,
  type: :type,
  actions: :actions,
  summary: :summary,
  change: :change,
  path: :path
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ DeclarativePlanResourceChange

Returns a new instance of DeclarativePlanResourceChange.



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 31

def initialize(json)
  hash = self.class.normalize(json)
  @address = hash[:address]
  @target = hash[:target]
  @target_id = hash[:target_id]
  @name = hash[:name]
  @type = hash[:type]
  @actions = (hash[:actions] || [])
  @summary = hash[:summary]
  @change = hash[:change] ? Retab::DeclarativePlanChange.new(hash[:change]) : nil
  @path = hash[:path]
end

Instance Attribute Details

#actionsObject

Returns the value of attribute actions.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def actions
  @actions
end

#addressObject

Returns the value of attribute address.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def address
  @address
end

#changeObject

Returns the value of attribute change.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def change
  @change
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def name
  @name
end

#pathObject

Returns the value of attribute path.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def path
  @path
end

#summaryObject

Returns the value of attribute summary.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def summary
  @summary
end

#targetObject

Returns the value of attribute target.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def target
  @target
end

#target_idObject

Returns the value of attribute target_id.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def target_id
  @target_id
end

#typeObject

Returns the value of attribute type.



20
21
22
# File 'lib/retab/workflow_specs/declarative_plan_resource_change.rb', line 20

def type
  @type
end