Class: Yt::Audit

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

Constant Summary collapse

VERSION =
"0.3.1"

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Audit


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

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


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

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