Class: Marti::Marticle
- Inherits:
-
Object
- Object
- Marti::Marticle
- Defined in:
- app/models/marti/marticle.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#extract ⇒ Object
readonly
Returns the value of attribute extract.
-
#last_updated_at ⇒ Object
readonly
Returns the value of attribute last_updated_at.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'app/models/marti/marticle.rb', line 3 def content @content end |
#extract ⇒ Object (readonly)
Returns the value of attribute extract.
3 4 5 |
# File 'app/models/marti/marticle.rb', line 3 def extract @extract end |
#last_updated_at ⇒ Object (readonly)
Returns the value of attribute last_updated_at.
3 4 5 |
# File 'app/models/marti/marticle.rb', line 3 def last_updated_at @last_updated_at end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'app/models/marti/marticle.rb', line 3 def path @path end |
Class Method Details
.articles ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/models/marti/marticle.rb', line 5 def self.articles articles = [] Dir[File.join(Marti.article_directory, "*.md")].each do |file| path = file.gsub(/^.*\//, "").gsub(/\.md/, "") articles << Marti::MarticleBuilder.new(path).build end articles.sort_by(&:last_updated_at) articles end |