Sha256: 9ce56d491ad1c8d2fdb8f2a4aa5d3b022c9e68c50fc5ed7c0e2dd4b05823ec17

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

require 'yt/video_audit/base'

module Yt
  module VideoAudit
    # Count how many subject videos have an end screens
    # with a website link.
    class WebsiteEndScreen < Base
      def title
        'Website End Screens'
      end

      def description
        'The number of videos with any external link in its end screens'
      end

    private

      def valid?(video)
        Yt::Annotations.for(video.id).any? do |annotation|
          annotation.instance_of?(Yt::Annotations::EndScreen) &&
          annotation.link && annotation.link[:type] == :website
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yt-audit-0.5.2 lib/yt/video_audit/website_end_screen.rb