Class: NoteFormatter::Formatter
- Inherits:
-
Object
- Object
- NoteFormatter::Formatter
- Includes:
- Helpers::Configuration
- Defined in:
- lib/note_formatter/formatter.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#note ⇒ Object
Returns the value of attribute note.
Instance Method Summary collapse
- #format_file ⇒ Object
-
#initialize(format, note) ⇒ Formatter
constructor
A new instance of Formatter.
Methods included from Helpers::Configuration
Constructor Details
#initialize(format, note) ⇒ Formatter
Returns a new instance of Formatter.
9 10 11 12 |
# File 'lib/note_formatter/formatter.rb', line 9 def initialize(format, note) @format = format @note = note end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
7 8 9 |
# File 'lib/note_formatter/formatter.rb', line 7 def format @format end |
#note ⇒ Object
Returns the value of attribute note.
7 8 9 |
# File 'lib/note_formatter/formatter.rb', line 7 def note @note end |
Instance Method Details
#format_file ⇒ Object
14 15 16 17 18 19 |
# File 'lib/note_formatter/formatter.rb', line 14 def format_file file = File.new("./#{note.date}.txt", "w") header file body file file.close end |