Class: Retab::ReviewVersion
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ReviewVersion
- 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
-
#author ⇒ Object
Returns the value of attribute author.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#note ⇒ Object
Returns the value of attribute note.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#review_id ⇒ Object
Returns the value of attribute review_id.
-
#snapshot ⇒ Object
Returns the value of attribute snapshot.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ReviewVersion
constructor
A new instance of ReviewVersion.
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
#author ⇒ Object
Returns the value of attribute author.
18 19 20 |
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18 def @author end |
#created_at ⇒ Object
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 |
#id ⇒ Object
Returns the value of attribute id.
18 19 20 |
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18 def id @id end |
#note ⇒ Object
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_id ⇒ Object
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_id ⇒ Object
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 |
#snapshot ⇒ Object
Returns the value of attribute snapshot.
18 19 20 |
# File 'lib/retab/workflow_review_versions/review_version.rb', line 18 def snapshot @snapshot end |