Class: Potion::Post
- Inherits:
-
Renderable
- Object
- Renderable
- Potion::Post
- Defined in:
- lib/potion/post.rb
Instance Attribute Summary collapse
-
#static_files ⇒ Object
Returns the value of attribute static_files.
Attributes inherited from Renderable
#content, #layout, #metadata, #output_path, #path, #relative_output_path, #site
Instance Method Summary collapse
-
#initialize(path, site) ⇒ Post
constructor
A new instance of Post.
- #write ⇒ Object
Methods inherited from Renderable
#==, #is_html?, #load_content_and_metadata, #render, #title
Methods included from Helpers
Constructor Details
#initialize(path, site) ⇒ Post
Returns a new instance of Post.
5 6 7 8 9 10 11 |
# File 'lib/potion/post.rb', line 5 def initialize(path, site) @static_files = Dir[File.dirname(path) + "/*.*"].reject {|x| x == path}.map {|x| Potion::StaticFile.new(x, site)} @relative_output_path = path.gsub("_posts/", "") super(path, site) end |
Instance Attribute Details
#static_files ⇒ Object
Returns the value of attribute static_files.
3 4 5 |
# File 'lib/potion/post.rb', line 3 def static_files @static_files end |
Instance Method Details
#write ⇒ Object
13 14 15 16 |
# File 'lib/potion/post.rb', line 13 def write @static_files.each {|file| file.write } super end |