lib/feedjira/podcast/channel/optional.rb in feedjira-podcast-0.9.12 vs lib/feedjira/podcast/channel/optional.rb in feedjira-podcast-0.9.13

- old
+ new

@@ -14,30 +14,27 @@ def image @image ||= image_struct.new(*image_params) end def skip - @skip ||= Struct.new(:hours, :days).new( - skip_hours.hours, - skip_days.days - ) + @skip ||= skip_struct.new(*skip_params) end private def cloud_struct - Struct.new(:domain, :port, :path, :registerProcedure, :protocol) + Struct.new(:domain, :port, :path, :register_procedure, :protocol) end def cloud_params return [] unless _cloud [ _cloud.domain, _cloud.port, _cloud.path, - _cloud.registerProcedure, + _cloud.register_procedure, _cloud.protocol ] end def image_struct @@ -54,10 +51,21 @@ _image.width, _image.height, _image.description ] end + + def skip_struct + Struct.new(:hours, :days) + end + + def skip_params + [ + skip_hours.hours, + skip_days.days + ] + end end def self.included(base) base.include(InstanceMethods) @@ -96,11 +104,11 @@ base.element :image, as: :_image, class: Image base.element :rating base.element :textInput, as: :text_input, class: TextInput, default: Struct.new(:title, :description, :name, :link).new - base.element :skipHours, as: :skip_hours, class: SkipHours - base.element :skipDays, as: :skip_days, class: SkipDays + base.element :skipHours, as: :skip_hours, class: SkipHours, default: Struct.new(:hours).new([]) + base.element :skipDays, as: :skip_days, class: SkipDays, default: Struct.new(:days).new([]) end end end end end