123456789_123456789_123456789_123456789_123456789_

Class: RSS::Maker::Atom::Feed::Channel

Constant Summary

::RSS::Maker::Base - Inherited

NEED_INITIALIZE_VARIABLES, OTHER_ELEMENTS

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

This class inherits a constructor from RSS::Maker::Base

Instance Attribute Details

#have_required_values?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 44

def have_required_values?
  super and
    (!authors.empty? or
     @maker.items.any? {|item| !item.authors.empty?})
end

#variable_is_set?Boolean (readonly, private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 59

def variable_is_set?
  super or !authors.empty?
end

Instance Method Details

#_set_default_values(&block) (private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 73

def _set_default_values(&block)
  keep = {
    :id => id,
  }
  self.id ||= about
  super(&block)
ensure
  self.id = keep[:id]
end

#not_set_required_variables (private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 63

def not_set_required_variables
  vars = super
  if authors.empty? and
      @maker.items.all? {|item| item.author.to_s.empty?}
    vars << "author"
  end
  vars << "title" unless title {|t| t.have_required_values?}
  vars
end

#required_variable_names (private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 51

def required_variable_names
  %w(id updated)
end

#to_feed(feed)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 27

def to_feed(feed)
  set_default_values do
    setup_values(feed)
    feed.dc_dates.clear
    setup_other_elements(feed)
    if image_favicon.about
      icon = feed.class::Icon.new
      icon.content = image_favicon.about
      feed.icon = icon
    end
    unless have_required_values?
      raise NotSetError.new("maker.channel",
                            not_set_required_variables)
    end
  end
end

#variables (private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 55

def variables
  super + %w(id updated)
end