Class: Retab::WorkflowBlockVersionDiff

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_blocks/workflow_block_version_diff.rb

Constant Summary collapse

HASH_ATTRS =
{
  from_block_version_id: :from_block_version_id,
  to_block_version_id: :to_block_version_id,
  block_id: :block_id,
  changes: :changes
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowBlockVersionDiff

Returns a new instance of WorkflowBlockVersionDiff.



22
23
24
25
26
27
28
29
# File 'lib/retab/workflow_blocks/workflow_block_version_diff.rb', line 22

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @from_block_version_id = hash[:from_block_version_id]
  @to_block_version_id = hash[:to_block_version_id]
  @block_id = hash[:block_id]
  @changes = (hash[:changes] || []).map { |item| item ? Retab::WorkflowVersionFieldDiff.new(item) : nil }
end

Instance Attribute Details

#block_idObject

Returns the value of attribute block_id.



15
16
17
# File 'lib/retab/workflow_blocks/workflow_block_version_diff.rb', line 15

def block_id
  @block_id
end

#changesObject

Returns the value of attribute changes.



15
16
17
# File 'lib/retab/workflow_blocks/workflow_block_version_diff.rb', line 15

def changes
  @changes
end

#from_block_version_idObject

Returns the value of attribute from_block_version_id.



15
16
17
# File 'lib/retab/workflow_blocks/workflow_block_version_diff.rb', line 15

def from_block_version_id
  @from_block_version_id
end

#to_block_version_idObject

Returns the value of attribute to_block_version_id.



15
16
17
# File 'lib/retab/workflow_blocks/workflow_block_version_diff.rb', line 15

def to_block_version_id
  @to_block_version_id
end