Class: Viddler::Comment
- Inherits:
-
Object
- Object
- Viddler::Comment
- Defined in:
- lib/viddler/comment.rb
Overview
This class wraps Viddler’s comment’s information.
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#id ⇒ Object
Returns the value of attribute id.
-
#text ⇒ Object
Returns the value of attribute text.
-
#time ⇒ Object
Returns the value of attribute time.
-
#timepoint ⇒ Object
Returns the value of attribute timepoint.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Comment
constructor
:nodoc:.
Constructor Details
#initialize(attributes = {}) ⇒ Comment
:nodoc:
7 8 9 10 11 12 13 14 |
# File 'lib/viddler/comment.rb', line 7 def initialize(attributes={}) #:nodoc: a = attributes @id = a['id'] @author = a['author'] @text = a['text'] @time = Time.at(fix_unix_time(a['time'])) @timepoint = a['add_timepoint'].to_i / 1000 end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
5 6 7 |
# File 'lib/viddler/comment.rb', line 5 def @author end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/viddler/comment.rb', line 5 def id @id end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/viddler/comment.rb', line 5 def text @text end |
#time ⇒ Object
Returns the value of attribute time.
5 6 7 |
# File 'lib/viddler/comment.rb', line 5 def time @time end |
#timepoint ⇒ Object
Returns the value of attribute timepoint.
5 6 7 |
# File 'lib/viddler/comment.rb', line 5 def timepoint @timepoint end |