Feedzirra::FeedUtilities

Attributes

etag[RW]
last_modified[W]
new_entries[W]
updated[W]

Public Instance Methods

has_new_entries?() click to toggle source
# File lib/feedzirra/feed_utilities.rb, line 23
def has_new_entries?
  new_entries.size > 0
end
last_modified() click to toggle source
# File lib/feedzirra/feed_utilities.rb, line 8
def last_modified
  @last_modified ||= begin
    entry = entries.reject {|e| e.published.nil? }.sort_by { |entry| entry.published if entry.published }.last
    entry ? entry.published : nil
  end
end
new_entries() click to toggle source
# File lib/feedzirra/feed_utilities.rb, line 19
def new_entries
  @new_entries ||= []
end
sanitize_entries!() click to toggle source
# File lib/feedzirra/feed_utilities.rb, line 46
def sanitize_entries!
  entries.each {|entry| entry.sanitize!}
end
update_attribute(feed, name) click to toggle source
# File lib/feedzirra/feed_utilities.rb, line 38
def update_attribute(feed, name)
  old_value, new_value = send(name), feed.send(name)

  if old_value != new_value
    send("#{name}=", new_value)
  end
end
update_from_feed(feed) click to toggle source
# File lib/feedzirra/feed_utilities.rb, line 27
def update_from_feed(feed)
  self.new_entries += find_new_entries_for(feed)
  self.entries.unshift(*self.new_entries)

  @updated = false
  UPDATABLE_ATTRIBUTES.each do |name|
    updated = update_attribute(feed, name)
    @updated ||= updated
  end
end
updated?() click to toggle source
# File lib/feedzirra/feed_utilities.rb, line 15
def updated?
  @updated
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.