Class: Cliptic::Interface::Selector
- Inherits:
-
Windows::Window
- Object
- Curses::Window
- Windows::Window
- Cliptic::Interface::Selector
- Defined in:
- lib/cliptic/interface.rb
Direct Known Subclasses
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 collapse
-
#ctrls ⇒ Object
readonly
Returns the value of attribute ctrls.
-
#cursor ⇒ Object
Returns the value of attribute cursor.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#run ⇒ Object
readonly
Returns the value of attribute run.
-
#tick ⇒ Object
readonly
Returns the value of attribute tick.
Attributes inherited from Windows::Window
#centered_x, #centered_y, #col, #line, #x, #y
Instance Method Summary collapse
-
#initialize(opts:, ctrls:, x:, line:, tick: nil, y: opts.length, col: nil) ⇒ Selector
constructor
A new instance of Selector.
- #select ⇒ Object
- #stop ⇒ Object
Methods inherited from Windows::Window
#add_str, #bold, #clear, #color, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #time_str, #wrap_str
Methods included from Chars
Constructor Details
#initialize(opts:, ctrls:, x:, line:, tick: nil, y: opts.length, col: nil) ⇒ Selector
Returns a new instance of Selector.
108 109 110 111 112 113 |
# File 'lib/cliptic/interface.rb', line 108 def initialize(opts:, ctrls:, x:, line:, tick:nil, y:opts.length, col:nil) super(y:y, x:x, line:line, col:col) @opts, @ctrls, @tick = opts, ctrls, tick @cursor, @run = 0, true end |
Instance Attribute Details
#ctrls ⇒ Object (readonly)
Returns the value of attribute ctrls.
106 107 108 |
# File 'lib/cliptic/interface.rb', line 106 def ctrls @ctrls end |
#cursor ⇒ Object
Returns the value of attribute cursor.
107 108 109 |
# File 'lib/cliptic/interface.rb', line 107 def cursor @cursor end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
106 107 108 |
# File 'lib/cliptic/interface.rb', line 106 def opts @opts end |
#run ⇒ Object (readonly)
Returns the value of attribute run.
106 107 108 |
# File 'lib/cliptic/interface.rb', line 106 def run @run end |
#tick ⇒ Object (readonly)
Returns the value of attribute tick.
106 107 108 |
# File 'lib/cliptic/interface.rb', line 106 def tick @tick end |
Instance Method Details
#select ⇒ Object
114 115 116 117 118 119 |
# File 'lib/cliptic/interface.rb', line 114 def select while @run draw ctrls[getch]&.call end end |
#stop ⇒ Object
120 121 122 |
# File 'lib/cliptic/interface.rb', line 120 def stop @run = false end |