Class: Cliptic::Database::Stats
- Defined in:
- lib/cliptic/database.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 State
#chars, #date, #done, #n_done, #n_tot, #reveals, #time
Attributes inherited from SQL
Instance Method Summary collapse
- #exist_str ⇒ Object
-
#initialize(date: Date.today) ⇒ Stats
constructor
A new instance of Stats.
- #new_str ⇒ Object
- #stats_str ⇒ Object
Methods inherited from State
#cols, #delete, #exists?, #save
Methods included from Chars
Methods inherited from SQL
#delete, #drop, #insert, #make_table, #select, #update
Constructor Details
Instance Method Details
#exist_str ⇒ Object
171 172 173 174 175 176 177 |
# File 'lib/cliptic/database.rb', line 171 def exist_str <<~stats Time #{VL} #{Time.abs(time).to_s} Clues #{VL} #{n_done}/#{n_tot} Done #{VL} [#{done ? Tick : " "}] stats end |
#new_str ⇒ Object
178 179 180 |
# File 'lib/cliptic/database.rb', line 178 def new_str "\n Not attempted\n" end |
#stats_str ⇒ Object
168 169 170 |
# File 'lib/cliptic/database.rb', line 168 def stats_str (exists? ? exist_str : new_str).split("\n") end |