Class: Cliptic::Interface::Yes_No_Menu

Inherits:
Menu show all
Defined in:
lib/cliptic/interface.rb

Direct Known Subclasses

Main::Player::Menus::Reset_Progress

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

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

#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(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

#noObject (readonly)

Returns the value of attribute no.



259
260
261
# File 'lib/cliptic/interface.rb', line 259

def no
  @no
end

#post_procObject (readonly)

Returns the value of attribute post_proc.



259
260
261
# File 'lib/cliptic/interface.rb', line 259

def post_proc
  @post_proc
end

#yesObject (readonly)

Returns the value of attribute yes.



259
260
261
# File 'lib/cliptic/interface.rb', line 259

def yes
  @yes
end

Instance Method Details

#optsObject



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

#postObject



271
272
273
# File 'lib/cliptic/interface.rb', line 271

def post
  post_proc.call if post_proc
end