Class: Retab::ReviewDecision

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_reviews/review_decision.rb

Constant Summary collapse

HASH_ATTRS =
{
  verdict: :verdict,
  version_id: :version_id,
  author: :author,
  decided_at: :decided_at,
  reason: :reason
}.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) ⇒ ReviewDecision

Returns a new instance of ReviewDecision.



23
24
25
26
27
28
29
30
# File 'lib/retab/workflow_reviews/review_decision.rb', line 23

def initialize(json)
  hash = self.class.normalize(json)
  @verdict = hash[:verdict]
  @version_id = hash[:version_id]
  @author = hash[:author] ? Retab::Actor.new(hash[:author]) : nil
  @decided_at = hash[:decided_at]
  @reason = hash[:reason]
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



16
17
18
# File 'lib/retab/workflow_reviews/review_decision.rb', line 16

def author
  @author
end

#decided_atObject

Returns the value of attribute decided_at.



16
17
18
# File 'lib/retab/workflow_reviews/review_decision.rb', line 16

def decided_at
  @decided_at
end

#reasonObject

Returns the value of attribute reason.



16
17
18
# File 'lib/retab/workflow_reviews/review_decision.rb', line 16

def reason
  @reason
end

#verdictObject

Returns the value of attribute verdict.



16
17
18
# File 'lib/retab/workflow_reviews/review_decision.rb', line 16

def verdict
  @verdict
end

#version_idObject

Returns the value of attribute version_id.



16
17
18
# File 'lib/retab/workflow_reviews/review_decision.rb', line 16

def version_id
  @version_id
end