Class: Cliptic::Interface::Yes_No_Menu
- Inherits:
-
Menu
- Object
- Curses::Window
- Windows::Window
- Menu_Box
- Menu
- Cliptic::Interface::Yes_No_Menu
- 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
-
#no ⇒ Object
readonly
Returns the value of attribute no.
-
#post_proc ⇒ Object
readonly
Returns the value of attribute post_proc.
-
#yes ⇒ Object
readonly
Returns the value of attribute yes.
Attributes inherited from Menu
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
-
#initialize(yes:, no: ->{back}, post_proc: nil, title: nil) ⇒ Yes_No_Menu
constructor
A new instance of Yes_No_Menu.
- #opts ⇒ Object
- #post ⇒ Object
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
Constructor Details
#initialize(yes:, no: ->{back}, post_proc: nil, title: nil) ⇒ Yes_No_Menu
Returns a new instance of Yes_No_Menu.
260 261 262 263 264 |
# File 'lib/cliptic/interface.rb', line 260 def initialize(yes:, no:->{back}, post_proc:nil, title:nil) super @title = title @yes, @no, @post_proc = yes, no, post_proc end |
Instance Attribute Details
#no ⇒ Object (readonly)
Returns the value of attribute no.
259 260 261 |
# File 'lib/cliptic/interface.rb', line 259 def no @no end |
#post_proc ⇒ Object (readonly)
Returns the value of attribute post_proc.
259 260 261 |
# File 'lib/cliptic/interface.rb', line 259 def post_proc @post_proc end |
#yes ⇒ Object (readonly)
Returns the value of attribute yes.
259 260 261 |
# File 'lib/cliptic/interface.rb', line 259 def yes @yes end |
Instance Method Details
#opts ⇒ Object
265 266 267 268 269 270 |
# File 'lib/cliptic/interface.rb', line 265 def opts { "Yes" => ->{yes.call; back; post}, "No" => ->{no.call; post} } end |
#post ⇒ Object
271 272 273 |
# File 'lib/cliptic/interface.rb', line 271 def post post_proc.call if post_proc end |