Class: RubyJard::Screens::MenuScreen

Inherits:
RubyJard::Screen show all
Defined in:
lib/ruby_jard/screens/menu_screen.rb

Overview

Display key binding guidelines and shortcuts.

Instance Attribute Summary

Attributes inherited from RubyJard::Screen

#cursor, #layout, #rows, #selected, #window

Instance Method Summary collapse

Methods inherited from RubyJard::Screen

#click, #move_down, #move_up, #page_down, #page_up

Constructor Details

#initialize(*args) ⇒ MenuScreen

Returns a new instance of MenuScreen.



8
9
10
11
12
13
14
# File 'lib/ruby_jard/screens/menu_screen.rb', line 8

def initialize(*args)
  super(*args)
  @filter = RubyJard.config.filter
  @filter_included = RubyJard.config.filter_included
  @filter_excluded = RubyJard.config.filter_excluded
  @selected = 0
end

Instance Method Details

#buildObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ruby_jard/screens/menu_screen.rb', line 16

def build
  left_spans = generate_left_spans
  right_spans = generate_right_spans
  @rows = [RubyJard::Row.new(
    line_limit: 1,
    columns: [
      RubyJard::Column.new(
        word_wrap: RubyJard::Column::WORD_WRAP_BREAK_WORD,
        spans: [
          left_spans,
          align(left_spans, right_spans),
          right_spans
        ].flatten
      )
    ]
  )]
end