Class: Yt::Models::StatisticsSet
- Defined in:
- lib/yt/models/statistics_set.rb
Overview
Encapsulates statistics about the resource, such as the number of times the resource has been viewed or liked.
Instance Method Summary collapse
-
#comment_count ⇒ Integer
The number of comments for the resource.
-
#dislike_count ⇒ Integer
The number of users who disliked the resource.
-
#favorite_count ⇒ Integer
The number of users who currently have the resource marked as a favorite resource.
-
#initialize(options = {}) ⇒ StatisticsSet
constructor
A new instance of StatisticsSet.
-
#like_count ⇒ Integer
The number of users who liked the resource.
-
#subscriber_count ⇒ Integer
The number of subscriber the resource has.
-
#subscriber_count_visible? ⇒ Boolean
Whether the number of subscribers is publicly visible.
-
#video_count ⇒ Integer
The number of videos updated to the resource.
-
#view_count ⇒ Integer
The number of times the resource has been viewed.
Methods included from Associations::HasReports
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
Constructor Details
#initialize(options = {}) ⇒ StatisticsSet
Returns a new instance of StatisticsSet.
9 10 11 |
# File 'lib/yt/models/statistics_set.rb', line 9 def initialize( = {}) @data = [:data] end |
Instance Method Details
#comment_count ⇒ Integer
Returns the number of comments for the resource.
19 20 21 |
# File 'lib/yt/models/statistics_set.rb', line 19 def comment_count @comment_count ||= @data['commentCount'].to_i end |
#dislike_count ⇒ Integer
Returns the number of users who disliked the resource.
29 30 31 |
# File 'lib/yt/models/statistics_set.rb', line 29 def dislike_count @dislike_count ||= @data['dislikeCount'].to_i end |
#favorite_count ⇒ Integer
Returns the number of users who currently have the resource marked as a favorite resource.
35 36 37 |
# File 'lib/yt/models/statistics_set.rb', line 35 def favorite_count @favorite_count ||= @data['favoriteCount'].to_i end |
#like_count ⇒ Integer
Returns the number of users who liked the resource.
24 25 26 |
# File 'lib/yt/models/statistics_set.rb', line 24 def like_count @like_count ||= @data['likeCount'].to_i end |
#subscriber_count ⇒ Integer
Returns the number of subscriber the resource has.
45 46 47 |
# File 'lib/yt/models/statistics_set.rb', line 45 def subscriber_count @subscriber_count ||= @data['subscriberCount'].to_i end |
#subscriber_count_visible? ⇒ Boolean
Returns whether the number of subscribers is publicly visible.
50 51 52 |
# File 'lib/yt/models/statistics_set.rb', line 50 def subscriber_count_visible? @subscriber_count_visible ||= @data['hiddenSubscriberCount'] == false end |
#video_count ⇒ Integer
Returns the number of videos updated to the resource.
40 41 42 |
# File 'lib/yt/models/statistics_set.rb', line 40 def video_count @video_count ||= @data['videoCount'].to_i end |
#view_count ⇒ Integer
Returns the number of times the resource has been viewed.
14 15 16 |
# File 'lib/yt/models/statistics_set.rb', line 14 def view_count @view_count ||= @data['viewCount'].to_i end |