class HighLine::Menu::Item
Represents an Item of a HighLine::Menu.
def initialize(name, attributes)
(**attributes)
-
action:
(Block
) -- a block that gets called when choice -
help:
(String
) -- help/hint string to be displayed. -
text:
(String
) -- The text that displays for that
Parameters:
-
attributes
(Hash
) -- options Hash to tailor menu item to your needs -
name
(String
) -- The name that is matched against the user input
def initialize(name, attributes) @name = name @text = attributes[:text] || @name @help = attributes[:help] @action = attributes[:action] end
def item_help
def item_help return {} unless help { name.to_s.downcase => help } end