lib/feedjira/podcast/channel/apple.rb in feedjira-podcast-0.9.6 vs lib/feedjira/podcast/channel/apple.rb in feedjira-podcast-0.9.7
- old
+ new
@@ -4,26 +4,21 @@
module Apple
def self.included(base)
base.element :"itunes:author", as: :itunes_author
- base.element :"itunes:block", as: :itunes_block do |block|
- block == 'yes'
- end
+ base.element :"itunes:block", as: :_itunes_block
base.elements :"itunes:category", as: :itunes_categories, class: AppleCategory
base.element :"itunes:image", as: :itunes_image_href, value: :href do |href|
Addressable::URI.parse(href)
end
base.element :"itunes:explicit", as: :_itunes_explicit
+ base.element :"itunes:complete", as: :_itunes_complete
- base.element :"itunes:complete", as: :itunes_complete do |complete|
- complete == 'yes'
- end
-
base.element :"itunes:new_feed_url", as: :itunes_new_feed_url do |url|
Addressable::URI.parse(url)
end
base.element :"itunes:owner", as: :_itunes_owner, class: AppleOwner
@@ -68,9 +63,17 @@
private
def itunes_image
@itunes_image ||= Struct.new(:href).new(itunes_image_href)
+ end
+
+ def itunes_block
+ @itunes_block ||= (_itunes_block == 'yes')
+ end
+
+ def itunes_complete
+ @itunes_complete ||= (_itunes_complete == 'yes')
end
def itunes_explicit
@itunes_explicit ||= (_itunes_explicit == 'yes')
end