Class: ZettelOutline::Zettel
- Inherits:
-
Object
- Object
- ZettelOutline::Zettel
- Defined in:
- lib/zettel_outline/zettel.rb
Instance Method Summary collapse
- #file_contents ⇒ Object
-
#initialize(path) ⇒ Zettel
constructor
A new instance of Zettel.
- #remove_header(text) ⇒ Object
- #render ⇒ Object
Constructor Details
#initialize(path) ⇒ Zettel
Returns a new instance of Zettel.
3 4 5 6 7 8 |
# File 'lib/zettel_outline/zettel.rb', line 3 def initialize(path) raise "file path needed" if path.nil? raise "file expected at path" unless File.file?(path) @path = path end |
Instance Method Details
#file_contents ⇒ Object
14 15 16 |
# File 'lib/zettel_outline/zettel.rb', line 14 def file_contents File.readlines(@path) end |
#remove_header(text) ⇒ Object
18 19 20 |
# File 'lib/zettel_outline/zettel.rb', line 18 def remove_header(text) text end |
#render ⇒ Object
10 11 12 |
# File 'lib/zettel_outline/zettel.rb', line 10 def render remove_header(file_contents).join("") end |