Method: CLI::UI::Widgets.lookup
- Defined in:
- lib/cli/ui/widgets.rb
.lookup(handle) ⇒ Object
Looks up a widget by handle
Raises
Raises InvalidWidgetHandle if the widget is not available.
Returns
A callable widget, to be invoked like ‘.call(argstring)`
: (String handle) -> singleton(Widgets::Base)
42 43 44 45 46 |
# File 'lib/cli/ui/widgets.rb', line 42 def lookup(handle) MAP.fetch(handle).call rescue KeyError, NameError raise(InvalidWidgetHandle, handle) end |