class Writetheman::Blog

Public Class Methods

new(path_application) click to toggle source
# File lib/writetheman/blog.rb, line 6
def initialize(path_application)
  @path_application = path_application
end

Public Instance Methods

list_articles() click to toggle source
# File lib/writetheman/blog.rb, line 16
def list_articles
  articles = []
  list_source_files.each do |filepath|
    articles << new_article(Pathname.new(filepath).basename.to_s)
  end
  articles
end
new_article(filename='') click to toggle source
# File lib/writetheman/blog.rb, line 10
def new_article(filename='')
  article = Article::Base.new(@path_application)
  article.load_from_file(filename) if !filename.empty?
  article
end