1
0
Fork 0
forked from wezm/wezm.net
wezm.net/lib/articles.rb
2010-02-01 12:58:26 +11:00

23 lines
No EOL
498 B
Ruby

module WezM
module Helpers
module Articles
def personal_articles
sorted_articles.select { |a| a.identifier =~ %r{^/personal/} }
end
def technical_articles
sorted_articles.select { |a| a.identifier =~ %r{^/technical/} }
end
def article_to_json(article)
{
:title => article[:title],
:path => article.identifier,
:date => Time.parse(article[:created_at]).rfc2822,
}
end
end
end
end