Class: Aardi::AbstractFeed

Inherits:
AbstractBlog show all
Defined in:
lib/aardi/abstract_feed.rb

Direct Known Subclasses

ATOMFeed, JSONFeed

Instance Attribute Summary

Attributes inherited from AbstractBlog

#key

Instance Method Summary collapse

Methods inherited from AbstractBlog

#metadata, #mtime, #title

Constructor Details

#initialize(posts, archive_path = nil, tag = nil) ⇒ AbstractFeed

Returns a new instance of AbstractFeed.



5
6
7
8
9
# File 'lib/aardi/abstract_feed.rb', line 5

def initialize(posts, archive_path = nil, tag = nil)
  @archive_path = archive_path
  @posts = posts
  @tag = tag
end

Instance Method Details

#renderObject



11
12
13
# File 'lib/aardi/abstract_feed.rb', line 11

def render
  write_target
end

#target_pathObject



15
16
17
18
19
# File 'lib/aardi/abstract_feed.rb', line 15

def target_path
  return "./#{@archive_path}/#{feed_file}" if @archive_path

  "./#{feed_file}"
end