Class: Markdo::AddCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/markdo/commands/add_command.rb

Instance Method Summary collapse

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from Markdo::Command

Instance Method Details

#run(task) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/markdo/commands/add_command.rb', line 5

def run(task)
  task = String(task)

  unless task.strip.empty?
    File.open(data_source.inbox_path, 'a') do |file|
      file.puts(template(task))
    end
  end
end