Class: Post
- Inherits:
-
Diary::Item
- Object
- Diary::Item
- Post
- Includes:
- Diary::Output, Diary::Template
- Defined in:
- lib/diary/post.rb
Constant Summary collapse
- @@base_directory =
'posts'
Constants included from Diary::Message
Diary::Message::Create, Diary::Message::Error, Diary::Message::Exist, Diary::Message::Identical, Diary::Message::Invoke, Diary::Message::Publish, Diary::Message::Skip, Diary::Message::Update
Constants inherited from Diary::Item
Instance Attribute Summary
Attributes inherited from Diary::Item
Instance Method Summary collapse
- #date ⇒ Object
-
#initialize(title_or_file) ⇒ Post
constructor
A new instance of Post.
- #output(force = false) ⇒ Object
Methods included from Diary::Output
Methods included from Diary::Message
Methods included from Diary::Template
Methods inherited from Diary::Item
all, #data, #directory, first, last, #path, #slug, #title
Constructor Details
#initialize(title_or_file) ⇒ Post
Returns a new instance of Post.
7 8 9 |
# File 'lib/diary/post.rb', line 7 def initialize(title_or_file) super(title_or_file) end |
Instance Method Details
#date ⇒ Object
11 12 13 |
# File 'lib/diary/post.rb', line 11 def date Date.parse(directory) end |
#output(force = false) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/diary/post.rb', line 15 def output(force = false) if date <= Date.today super(force) else say Skip, path end end |