Class: BruteCLI::REPL::FzfMenu::Menu
- Inherits:
-
Object
- Object
- BruteCLI::REPL::FzfMenu::Menu
- Defined in:
- lib/brute_cli/repl/fzf_menu.rb
Instance Attribute Summary collapse
-
#choices ⇒ Object
readonly
Returns the value of attribute choices.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #choice(label, target) ⇒ Object
-
#initialize(title = nil) ⇒ Menu
constructor
A new instance of Menu.
- #resolved_title ⇒ Object
Constructor Details
#initialize(title = nil) ⇒ Menu
Returns a new instance of Menu.
39 40 41 42 |
# File 'lib/brute_cli/repl/fzf_menu.rb', line 39 def initialize(title = nil) @title = title @choices = [] end |
Instance Attribute Details
#choices ⇒ Object (readonly)
Returns the value of attribute choices.
37 38 39 |
# File 'lib/brute_cli/repl/fzf_menu.rb', line 37 def choices @choices end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
37 38 39 |
# File 'lib/brute_cli/repl/fzf_menu.rb', line 37 def title @title end |
Instance Method Details
#choice(label, target) ⇒ Object
48 49 50 |
# File 'lib/brute_cli/repl/fzf_menu.rb', line 48 def choice(label, target) @choices << [label, target] end |
#resolved_title ⇒ Object
44 45 46 |
# File 'lib/brute_cli/repl/fzf_menu.rb', line 44 def resolved_title @title.respond_to?(:call) ? @title.call : @title.to_s end |