Module: Feedjira::Podcast::Channel::Atom

Included in:
RSS::Channel
Defined in:
lib/feedjira/podcast/channel/atom.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/feedjira/podcast/channel/atom.rb', line 36

def self.included(base)
  base.include(InstanceMethods)

  ["self", "hub"].each do |rel|
    [:"atom:link", :"atom10:link"].each do |ns|
      base.element ns, with: { rel: rel }, as: "atom_#{rel}_link_href".to_sym, value: :href do |href|
        Addressable::URI.parse(href.strip)
      end
      base.element ns, with: { rel: rel }, as: "atom_#{rel}_link_rel".to_sym, value: :rel
      base.element ns, with: { rel: rel }, as: "atom_#{rel}_link_type".to_sym, value: :type
    end
  end
end