Class: Slidr::Commands::SaveToFileCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Slidr::Commands::SaveToFileCommand
- Defined in:
- lib/slidr/commands/save_to_file_command.rb
Instance Method Summary collapse
- #go(content) ⇒ Object
-
#initialize(path) ⇒ SaveToFileCommand
constructor
A new instance of SaveToFileCommand.
Methods inherited from BaseCommand
Constructor Details
#initialize(path) ⇒ SaveToFileCommand
Returns a new instance of SaveToFileCommand.
6 7 8 |
# File 'lib/slidr/commands/save_to_file_command.rb', line 6 def initialize(path) @path = path end |
Instance Method Details
#go(content) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/slidr/commands/save_to_file_command.rb', line 10 def go(content) File.open(@path, "w") do |file| file.puts content end content end |