Class: RandomYoutubeComment::Comment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeComment

Returns a new instance of Comment.



7
8
9
10
11
12
13
14
# File 'lib/random_youtube_comment/comment.rb', line 7

def initialize
  @video = RandomYoutubeComment::YoutubeClient.random_video
  @video_id = @video.unique_id

  @youtube_it_comment = RandomYoutubeComment::YoutubeClient.random_comment_for_video(@video_id)
  @id, @author = @youtube_it_comment.url.split(":").last, @youtube_it_comment.author.name
  @body, @title =  @youtube_it_comment.content, @youtube_it_comment.title
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



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

def author
  @author
end

#bodyObject

Returns the value of attribute body.



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

def body
  @body
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#videoObject

Returns the value of attribute video.



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

def video
  @video
end

#video_idObject

Returns the value of attribute video_id.



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

def video_id
  @video_id
end

#youtube_it_commentObject

Returns the value of attribute youtube_it_comment.



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

def youtube_it_comment
  @youtube_it_comment
end