lib/feedjira/podcast/item/apple.rb in feedjira-podcast-0.9.6 vs lib/feedjira/podcast/item/apple.rb in feedjira-podcast-0.9.7
- old
+ new
@@ -3,15 +3,12 @@
module Item
module Apple
def self.included(base)
base.element :"itunes:author", as: :itunes_author
+ base.element :"itunes:block", as: :_itunes_block
- base.element :"itunes:block", as: :itunes_block do |block|
- block == 'yes'
- end
-
base.element :"itunes:image", as: :itunes_image_href, value: :href do |href|
Addressable::URI.parse(href)
end
base.element :"itunes:duration", as: :itunes_duration do |d|
@@ -20,19 +17,16 @@
end
end
base.element :"itunes:explicit", as: :_itunes_explicit
- base.element :"itunes:isClosedCaptioned", as: :itunes_is_closed_captioned do |is_closed_captioned|
- is_closed_captioned == 'yes'
- end
-
+ base.element :"itunes:isClosedCaptioned", as: :_itunes_is_closed_captioned
+
base.element :"itunes:order", as: :itunes_order do |order|
order.to_f
end
-
base.element :"itunes:subtitle", as: :itunes_subtitle
base.element :"itunes:summary", as: :itunes_summary
# Legacy support
@@ -72,11 +66,15 @@
def itunes_image
@itunes_image ||= Struct.new(:href).new(itunes_image_href)
end
- def itunes_duration
+ def itunes_block
+ @itunes_block ||= (_itunes_block == 'yes')
+ end
+ def itunes_is_closed_captioned
+ @itunes_is_closed_captioned ||= (_itunes_is_closed_captioned == 'yes')
end
def itunes_explicit
@itunes_explicit ||= (_itunes_explicit == 'yes')
end