Class: Retab::ReviewVersion

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_review_versions/review_version.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  review_id: :review_id,
  parent_id: :parent_id,
  author: :author,
  snapshot: :snapshot,
  note: :note,
  created_at: :created_at
}.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) ⇒ ReviewVersion

Returns a new instance of ReviewVersion.



27
28
29
30
31
32
33
34
35
36
# File 'lib/retab/workflow_review_versions/review_version.rb', line 27

def initialize(json)
  hash = self.class.normalize(json)
  @id = hash[:id]
  @review_id = hash[:review_id]
  @parent_id = hash[:parent_id]
  @author = hash[:author] ? Retab::Actor.new(hash[:author]) : nil
  @snapshot = hash[:snapshot] || {}
  @note = hash[:note]
  @created_at = hash[:created_at]
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



18
19
20
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18

def author
  @author
end

#created_atObject

Returns the value of attribute created_at.



18
19
20
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18

def id
  @id
end

#noteObject

Returns the value of attribute note.



18
19
20
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18

def note
  @note
end

#parent_idObject

Returns the value of attribute parent_id.



18
19
20
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18

def parent_id
  @parent_id
end

#review_idObject

Returns the value of attribute review_id.



18
19
20
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18

def review_id
  @review_id
end

#snapshotObject

Returns the value of attribute snapshot.



18
19
20
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18

def snapshot
  @snapshot
end