Class: Markdo::WeekCommand

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

Overview

TODO: More testing of this logic. As of 2016-01-23, I was building this project as a proof of concept.

Direct Known Subclasses

ForecastCommand

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWeekCommand

Returns a new instance of WeekCommand.



10
11
12
13
# File 'lib/markdo/week_command.rb', line 10

def initialize(*)
  @date = Date.today
  super
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



8
9
10
# File 'lib/markdo/week_command.rb', line 8

def date
  @date
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
# File 'lib/markdo/week_command.rb', line 15

def run
  query_command = QueryCommand.new(@stdout, @stderr, @env)

  dates_over_the_next_week.each do |query|
    query_command.run(query)
  end
end