Class: OrgMode::Presenters::Agenda::Console
- Inherits:
-
Object
- Object
- OrgMode::Presenters::Agenda::Console
- Defined in:
- lib/org_mode/presenters/console.rb
Instance Method Summary collapse
-
#initialize(reporter) ⇒ Console
constructor
A new instance of Console.
- #open_items_per_day_colorized ⇒ Object
Constructor Details
#initialize(reporter) ⇒ Console
Returns a new instance of Console.
9 10 11 |
# File 'lib/org_mode/presenters/console.rb', line 9 def initialize reporter @agenda_reporter = reporter end |
Instance Method Details
#open_items_per_day_colorized ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/org_mode/presenters/console.rb', line 13 def open_items_per_day_colorized capture_stdout do now = DateTime.now puts "Agenda: open items grouped by day [#{now.strftime('%Y-%m-%d %H:%M')}]".yellow.underline puts ongbd = @agenda_reporter.open_nodes_grouped_by_day ongbd.each do |e| puts "#{e.date}".blue.underline e.nodes.each do |n| color = :green color = :red if n.date_start_time && n.node.date_start_time < now color = :red if n.date && n.node.date < now puts " " + node_line(n).send(color) end puts end end end |