Class: YoutubeVideo::Comment

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

Overview

signle comment on video’s comment threads

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data: nil) ⇒ Comment

Returns a new instance of Comment.



12
13
14
# File 'lib/YPBT/comment.rb', line 12

def initialize(data: nil)
  load_data(data)
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



9
10
11
# File 'lib/YPBT/comment.rb', line 9

def author
  @author
end

#comment_idObject (readonly)

Returns the value of attribute comment_id.



9
10
11
# File 'lib/YPBT/comment.rb', line 9

def comment_id
  @comment_id
end

#like_countObject (readonly)

Returns the value of attribute like_count.



9
10
11
# File 'lib/YPBT/comment.rb', line 9

def like_count
  @like_count
end

#published_atObject (readonly)

Returns the value of attribute published_at.



9
10
11
# File 'lib/YPBT/comment.rb', line 9

def published_at
  @published_at
end

#text_displayObject (readonly)

Returns the value of attribute text_display.



9
10
11
# File 'lib/YPBT/comment.rb', line 9

def text_display
  @text_display
end

#time_tagsObject (readonly)

Returns the value of attribute time_tags.



9
10
11
# File 'lib/YPBT/comment.rb', line 9

def time_tags
  @time_tags
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



9
10
11
# File 'lib/YPBT/comment.rb', line 9

def updated_at
  @updated_at
end

Class Method Details

.find(comment_id:) ⇒ Object



16
17
18
19
# File 'lib/YPBT/comment.rb', line 16

def self.find(comment_id:)
  comment_data = YoutubeVideo::YtApi.comment_info(comment_id)
  new(data: comment_data)
end