Class: Viddler::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/viddler/comment.rb

Overview

This class wraps Viddler’s comment’s information.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#authorObject

Returns the value of attribute author.



5
6
7
# File 'lib/viddler/comment.rb', line 5

def author
  @author
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/viddler/comment.rb', line 5

def id
  @id
end

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/viddler/comment.rb', line 5

def text
  @text
end

#timeObject

Returns the value of attribute time.



5
6
7
# File 'lib/viddler/comment.rb', line 5

def time
  @time
end

#timepointObject

Returns the value of attribute timepoint.



5
6
7
# File 'lib/viddler/comment.rb', line 5

def timepoint
  @timepoint
end