Sha256: 52fef651f3b09e52b9ae8ee369f115550f57460d9a01c81f039577c6b85e2283

Contents?: true

Size: 584 Bytes

Versions: 5

Compression:

Stored size: 584 Bytes

Contents

module Yt
  module PlaylistAudit
    # Count how many playlists have its description.
    class Description
      def initialize(options={})
        @playlists = options[:playlists]
      end

      def total_count
        @playlists.size
      end

      def valid_count
        @playlists.count {|playlist| valid? playlist}
      end

      def title
        'Playlist Description'
      end

      def description
        'The number of playlists with description'
      end

    private

      def valid?(playlist)
        !playlist.description.empty?
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yt-audit-0.5.0 lib/yt/playlist_audit/description.rb
yt-audit-0.4.0 lib/yt/playlist_audit/description.rb
yt-audit-0.3.2 lib/yt/playlist_audit/description.rb
yt-audit-0.3.1 lib/yt/playlist_audit/description.rb
yt-audit-0.3.0 lib/yt/playlist_audit/description.rb