Class: Yt::Audit

Inherits:
Object
  • Object
show all
Defined in:
lib/yt/audit.rb,
lib/yt/audit/version.rb

Constant Summary collapse

VERSION =
'0.4.0'

Instance Method Summary collapse

Constructor Details

#initialize(channel:, videos: nil, playlists: nil, brand: nil) ⇒ Audit

Returns a new instance of Audit.



13
14
15
16
17
18
# File 'lib/yt/audit.rb', line 13

def initialize(channel:, videos: nil, playlists: nil, brand: nil)
  @channel = channel
  @videos = videos || channel.videos.includes(:snippet).first(10)
  @playlists = playlists || channel.playlists.first(10)
  @brand = brand || channel.title
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/yt/audit.rb', line 20

def run
  [
    Yt::VideoAudit::InfoCard.new(videos: @videos),
    Yt::VideoAudit::BrandAnchoring.new(videos: @videos, brand: @brand),
    Yt::VideoAudit::SubscribeAnnotation.new(videos: @videos),
    Yt::VideoAudit::YoutubeAssociation.new(videos: @videos),
    Yt::VideoAudit::EndCard.new(videos: @videos),
    Yt::PlaylistAudit::Description.new(playlists: @playlists)
  ]
end