Class: Cliptic::Interface::Stat_Window

Inherits:
Windows::Window show all
Defined in:
lib/cliptic/interface.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 Windows::Window

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

Instance Method Summary collapse

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(y: 5, x: 33, line:) ⇒ Stat_Window

Returns a new instance of Stat_Window.



152
153
154
# File 'lib/cliptic/interface.rb', line 152

def initialize(y:5, x:33, line:)
  super(y:y, x:x, line:line)
end

Instance Method Details

#get_stats(date:) ⇒ Object



163
164
165
# File 'lib/cliptic/interface.rb', line 163

def get_stats(date:)
  Database::Stats.new(date:date).stats_str
end

#show(date:, cp: ) ⇒ Object



155
156
157
158
159
160
161
162
# File 'lib/cliptic/interface.rb', line 155

def show(date:, cp:$colors[:stats])
  draw(clr:true).color(cp)
  get_stats(date:date).each_with_index do |line, i|
    setpos(i+1, 8)
    self << line
  end
  color.noutrefresh
end