Class: Rev::Comment
- Inherits:
-
ApiSerializable
- Object
- ApiSerializable
- Rev::Comment
- Defined in:
- lib/rev-api/models/order.rb
Overview
Order comment, containing author, creation timestamp and text
Instance Attribute Summary collapse
-
#by ⇒ Object
readonly
Returns the value of attribute by.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(fields) ⇒ Comment
constructor
A new instance of Comment.
Methods inherited from ApiSerializable
Constructor Details
#initialize(fields) ⇒ Comment
Returns a new instance of Comment.
51 52 53 54 55 |
# File 'lib/rev-api/models/order.rb', line 51 def initialize(fields) super fields @timestamp = Date.iso8601(fields['timestamp']) @text = fields['text'] ? fields['text'] : String.new # right now API gives no 'text' field if text is empty end |
Instance Attribute Details
#by ⇒ Object (readonly)
Returns the value of attribute by.
48 49 50 |
# File 'lib/rev-api/models/order.rb', line 48 def by @by end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
48 49 50 |
# File 'lib/rev-api/models/order.rb', line 48 def text @text end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
48 49 50 |
# File 'lib/rev-api/models/order.rb', line 48 def @timestamp end |