Class: Markdo::ForecastCommand

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

Instance Method Summary collapse

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from Markdo::Command

Instance Method Details

#runObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/markdo/commands/forecast_command.rb', line 6

def run
  dates_over_the_next_week.each do |date|
    abbreviation = abbreviations_by_wday(date.wday)
    count = task_collection.due_on(date).length

    @stdout.puts("#{abbreviation}: #{count}")
  end

  due_next_week = task_collection.due_between(@today + 7,
                                              @today + 14)
  @stdout.puts("Next: #{due_next_week.length}")
end