Class: Basher::UI::MenuView
- Defined in:
- lib/basher/ui/menu_view.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
Returns the value of attribute state.
Attributes inherited from BaseView
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BaseView
#clear, #initialize, #resize_and_reposition, #will_resize!
Constructor Details
This class inherits a constructor from Basher::UI::BaseView
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
5 6 7 |
# File 'lib/basher/ui/menu_view.rb', line 5 def state @state end |
Class Method Details
.lines ⇒ Object
7 8 9 |
# File 'lib/basher/ui/menu_view.rb', line 7 def self.lines 1 end |
Instance Method Details
#items ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/basher/ui/menu_view.rb', line 11 def items items = case state.current when :menu then %w([S]-Start [Q]-Quit) when :paused then %w([ESC]-Resume [Q]-Menu) else [] end items << "v #{Basher::VERSION}" items.join(' | ') end |
#setup ⇒ Object
21 22 23 |
# File 'lib/basher/ui/menu_view.rb', line 21 def setup puts items, h: :center end |