Class: Cliptic::Interface::SQL_Menu_With_Stats

Inherits:
Menu_With_Stats show all
Includes:
Database
Defined in:
lib/cliptic/interface.rb

Direct Known Subclasses

Menus::High_Scores, Menus::Recent_Puzzles

Constant Summary

Constants included from Database

Database::Dir_Path, Database::File_Path

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 collapse

Attributes inherited from Menu_With_Stats

#stat_win

Attributes inherited from Menu

#height, #selector

Attributes inherited from Menu_Box

#bot_b, #draw_bars, #logo, #title, #top_b

Attributes inherited from Windows::Window

#centered_x, #centered_y, #col, #line, #x, #y

Instance Method Summary collapse

Methods inherited from Menu_With_Stats

#enter, #hide, #reset_pos, #update_stats

Methods inherited from Menu

#back, #choose_opt, #ctrls, #enter, #hide, #redraw, #reset_pos, #show

Methods inherited from Menu_Box

#add_title, #draw, #line, #reset_pos

Methods inherited from Windows::Window

#add_str, #bold, #clear, #color, #draw, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #time_str, #wrap_str

Methods included from Chars

small_num

Constructor Details

#initialize(table:) ⇒ SQL_Menu_With_Stats

Returns a new instance of SQL_Menu_With_Stats.



246
247
248
249
250
# File 'lib/cliptic/interface.rb', line 246

def initialize(table:)
  @dates = table.new
    .select_list.map{|d| Date.parse(d[0])}
  super
end

Instance Attribute Details

#datesObject (readonly)

Returns the value of attribute dates.



245
246
247
# File 'lib/cliptic/interface.rb', line 245

def dates
  @dates
end

Instance Method Details

#optsObject



251
252
253
# File 'lib/cliptic/interface.rb', line 251

def opts
  dates.map{|d| d.to_long} || [nil]
end

#stat_dateObject



254
255
256
# File 'lib/cliptic/interface.rb', line 254

def stat_date
  dates[selector.cursor]
end