Class: Cliptic::Menus::This_Week
- Inherits:
-
Interface::Menu_With_Stats
- Object
- Curses::Window
- Windows::Window
- Interface::Menu_Box
- Interface::Menu
- Interface::Menu_With_Stats
- Cliptic::Menus::This_Week
- Defined in:
- lib/cliptic/menus.rb
Constant Summary
Constants included from Chars
Chars::Block, Chars::HL, Chars::LL, Chars::LS, Chars::LU, Chars::MS, Chars::Nums, Chars::RL, Chars::RS, Chars::RU, Chars::TD, Chars::TL, Chars::TR, Chars::TU, Chars::Tick, Chars::VL, Chars::XX
Instance Attribute Summary
Attributes inherited from Interface::Menu_With_Stats
Attributes inherited from Interface::Menu
Attributes inherited from Interface::Menu_Box
#bot_b, #draw_bars, #logo, #top_b
Attributes inherited from Windows::Window
#centered_x, #centered_y, #col, #line, #x, #y
Instance Method Summary collapse
Methods inherited from Interface::Menu_With_Stats
#enter, #hide, #initialize, #reset_pos, #update_stats
Methods inherited from Interface::Menu
#back, #choose_opt, #ctrls, #enter, #hide, #initialize, #redraw, #reset_pos, #show
Methods inherited from Interface::Menu_Box
#add_title, #draw, #initialize, #line, #reset_pos
Methods inherited from Windows::Window
#add_str, #bold, #clear, #color, #draw, #initialize, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #time_str, #wrap_str
Methods included from Chars
Constructor Details
This class inherits a constructor from Cliptic::Interface::Menu_With_Stats
Instance Method Details
#days ⇒ Object
103 104 105 |
# File 'lib/cliptic/menus.rb', line 103 def days @days || 7.times.map{|i| Date.today - i} end |
#opts ⇒ Object
109 110 111 |
# File 'lib/cliptic/menus.rb', line 109 def opts @opts || days.map{|d| d.strftime("%A").ljust(9).center(12) + tickbox(d)} end |
#stat_date ⇒ Object
106 107 108 |
# File 'lib/cliptic/menus.rb', line 106 def stat_date days[selector.cursor] end |
#tickbox(date) ⇒ Object
115 116 117 |
# File 'lib/cliptic/menus.rb', line 115 def tickbox(date) "[#{Database::State.new(date:date).done ? Chars::Tick : " "}]" end |
#title ⇒ Object
112 113 114 |
# File 'lib/cliptic/menus.rb', line 112 def title "This Week" end |