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.
45 46 47 48 49 |
# File 'lib/rev-api/models/order.rb', line 45 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.
42 43 44 |
# File 'lib/rev-api/models/order.rb', line 42 def by @by end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
42 43 44 |
# File 'lib/rev-api/models/order.rb', line 42 def text @text end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
42 43 44 |
# File 'lib/rev-api/models/order.rb', line 42 def @timestamp end |