Class: DayOne2MD::MarkdownEntry
- Inherits:
-
Object
- Object
- DayOne2MD::MarkdownEntry
- Includes:
- ActiveModel::Model
- Defined in:
- lib/dayone2md/markdown_entry.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#date ⇒ Object
Returns the value of attribute date.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
5 6 7 |
# File 'lib/dayone2md/markdown_entry.rb', line 5 def content @content end |
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/dayone2md/markdown_entry.rb', line 5 def date @date end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/dayone2md/markdown_entry.rb', line 5 def title @title end |
Instance Method Details
#dir ⇒ Object
23 24 25 |
# File 'lib/dayone2md/markdown_entry.rb', line 23 def dir @dir || Dir.pwd end |
#dir=(dir) ⇒ Object
19 20 21 |
# File 'lib/dayone2md/markdown_entry.rb', line 19 def dir=(dir) @dir = dir if dir end |
#filename ⇒ Object
9 10 11 12 13 |
# File 'lib/dayone2md/markdown_entry.rb', line 9 def filename s = [ formated_date ] s << formated_title if formated_title s.join(' ') + '.md' end |
#save ⇒ Object
15 16 17 |
# File 'lib/dayone2md/markdown_entry.rb', line 15 def save valid? ? (write_file; true) : false end |