Sha256: d4e9fd28b844546e68642e212b1e90ae0e154aa4b23f8492865d844d433ee0dc

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

module Feedjira
  module Podcast
    module Channel
      class AppleCategory
        include SAXMachine
        include FeedUtilities

        CATEGORIES = {
          "Arts" => [
            "Design",
            "Fashion & Beauty",
            "Food",
            "Literature",
            "Performing Arts",
            "Visual Arts"
          ],
          "Business" => [
            "Business News",
            "Careers",
            "Investing",
            "Management & Marketing",
            "Shopping"
          ],
          "Comedy" => [],
          "Education" => [

          ],
          "Games & Hobbies" => [

          ],
          "Government & Organizations" => [

          ],
          "Health" => [

          ],
          "Kids & Family" => [],
          "Music" => [],
          "News & Politics" => [],
          "Religion & Spirituality" => [

          ],
          "Science & Medicine" => [

          ],
          "Society & Culture" => [

          ],
          "Sports & Recreation" => [

          ],
          "Technology" => [

          ],
          "TV & Film" => []
        }

        attribute :text

        elements :"itunes:category", as: :subcategories, class: AppleSubcategory

        def subcategory
          if subcategories.first && subcategories.first.valid?(self)
            subcategories.first
          end
        end

        def valid?
          CATEGORIES.include?(text)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
feedjira-podcast-0.9.11 lib/feedjira/podcast/channel/apple_category.rb
feedjira-podcast-0.9.10 lib/feedjira/podcast/channel/apple_category.rb
feedjira-podcast-0.9.9 lib/feedjira/podcast/channel/apple_category.rb