<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Module: Doing::Prompt — Documentation by YARD 0.9.26 </title> <link rel="stylesheet" href="../css/style.css" type="text/css" /> <link rel="stylesheet" href="../css/common.css" type="text/css" /> <script type="text/javascript"> pathId = "Doing::Prompt"; relpath = '../'; </script> <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> <script type="text/javascript" charset="utf-8" src="../js/app.js"></script> </head> <body> <div class="nav_wrap"> <iframe id="nav" src="../class_list.html?1"></iframe> <div id="resizer"></div> </div> <div id="main" tabindex="-1"> <div id="header"> <div id="menu"> <a href="../_index.html">Index (P)</a> » <span class='title'><span class='object_link'><a href="../Doing.html" title="Doing (module)">Doing</a></span></span> » <span class="title">Prompt</span> </div> <div id="search"> <a class="full_list_link" id="class_list_link" href="../class_list.html"> <svg width="24" height="24"> <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> </svg> </a> </div> <div class="clear"></div> </div> <div id="content"><h1>Module: Doing::Prompt </h1> <div class="box_info"> <dl> <dt>Extended by:</dt> <dd><span class='object_link'><a href="Color.html" title="Doing::Color (module)">Color</a></span></dd> </dl> <dl> <dt>Defined in:</dt> <dd>lib/doing/prompt.rb</dd> </dl> </div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>Terminal Prompt methods</p> </div> </div> <div class="tags"> </div> <h2>Constant Summary</h2> <h3 class="inherited">Constants included from <span class='object_link'><a href="Color.html" title="Doing::Color (module)">Color</a></span></h3> <p class="inherited"><span class='object_link'><a href="Color.html#ATTRIBUTES-constant" title="Doing::Color::ATTRIBUTES (constant)">Color::ATTRIBUTES</a></span>, <span class='object_link'><a href="Color.html#ATTRIBUTE_NAMES-constant" title="Doing::Color::ATTRIBUTE_NAMES (constant)">Color::ATTRIBUTE_NAMES</a></span>, <span class='object_link'><a href="Color.html#COLORED_REGEXP-constant" title="Doing::Color::COLORED_REGEXP (constant)">Color::COLORED_REGEXP</a></span></p> <h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#default_answer-class_method" title="default_answer (class method)">.<strong>default_answer</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#force_answer-class_method" title="force_answer (class method)">.<strong>force_answer</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> </ul> <h2> Class Method Summary <small><a href="#" class="summary_toggle">collapse</a></small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="#choose_from-class_method" title="choose_from (class method)">.<strong>choose_from</strong>(options, prompt: 'Make a selection: ', multiple: false, sorted: true, fzf_args: []) ⇒ String </a> </span> <span class="summary_desc"><div class='inline'><p>Generate a menu of options and allow user selection.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#choose_from_items-class_method" title="choose_from_items (class method)">.<strong>choose_from_items</strong>(items, **opt) ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Create an interactive menu to select from a set of Items.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#enter_text-class_method" title="enter_text (class method)">.<strong>enter_text</strong>(prompt, default_response: '') ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#fzf-class_method" title="fzf (class method)">.<strong>fzf</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#install_fzf-class_method" title="install_fzf (class method)">.<strong>install_fzf</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#yn-class_method" title="yn (class method)">.<strong>yn</strong>(question, default_response: false) ⇒ Bool </a> </span> <span class="summary_desc"><div class='inline'><p>Ask a yes or no question in the terminal.</p> </div></span> </li> </ul> <h3 class="inherited">Methods included from <span class='object_link'><a href="Color.html" title="Doing::Color (module)">Color</a></span></h3> <p class="inherited"><span class='object_link'><a href="Color.html#attributes-class_method" title="Doing::Color.attributes (method)">attributes</a></span>, <span class='object_link'><a href="Color.html#coloring%3F-class_method" title="Doing::Color.coloring? (method)">coloring?</a></span>, <span class='object_link'><a href="Color.html#support%3F-instance_method" title="Doing::Color#support? (method)">support?</a></span>, <span class='object_link'><a href="Color.html#uncolor-instance_method" title="Doing::Color#uncolor (method)">uncolor</a></span></p> <div id="class_attr_details" class="attr_details"> <h2>Class Attribute Details</h2> <span id="default_answer=-class_method"></span> <div class="method_details first"> <h3 class="signature first" id="default_answer-class_method"> .<strong>default_answer</strong> ⇒ <tt>Object</tt> </h3> </div> <span id="force_answer=-class_method"></span> <div class="method_details "> <h3 class="signature " id="force_answer-class_method"> .<strong>force_answer</strong> ⇒ <tt>Object</tt> </h3> </div> </div> <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="choose_from-class_method"> .<strong>choose_from</strong>(options, prompt: 'Make a selection: ', multiple: false, sorted: true, fzf_args: []) ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt> </h3><div class="docstring"> <div class="discussion"> <p>Generate a menu of options and allow user selection</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span> — <div class='inline'><p>The selected option</p> </div> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="choose_from_items-class_method"> .<strong>choose_from_items</strong>(items, **opt) ⇒ <tt>Object</tt> </h3><div class="docstring"> <div class="discussion"> <p>Create an interactive menu to select from a set of Items</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>items</span> <span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>)</span> — <div class='inline'><p>list of items</p> </div> </li> <li> <span class='name'>opt</span> <span class='type'></span> — <div class='inline'><p>Additional options</p> </div> </li> </ul> <p class="tag_title">Options Hash (<tt>**opt</tt>):</p> <ul class="option"> <li> <span class="name">:include_section</span> <span class="type">(<tt>Boolean</tt>)</span> <span class="default"> </span> — <div class='inline'><p>Include section name for each item in menu</p> </div> </li> <li> <span class="name">:header</span> <span class="type">(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span> <span class="default"> </span> — <div class='inline'><p>A custom header string</p> </div> </li> <li> <span class="name">:prompt</span> <span class="type">(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span> <span class="default"> </span> — <div class='inline'><p>A custom prompt string</p> </div> </li> <li> <span class="name">:query</span> <span class="type">(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span> <span class="default"> </span> — <div class='inline'><p>Initial query</p> </div> </li> <li> <span class="name">:show_if_single</span> <span class="type">(<tt>Boolean</tt>)</span> <span class="default"> </span> — <div class='inline'><p>Show menu even if there's only one option</p> </div> </li> <li> <span class="name">:menu</span> <span class="type">(<tt>Boolean</tt>)</span> <span class="default"> </span> — <div class='inline'><p>Show menu</p> </div> </li> <li> <span class="name">:sort</span> <span class="type">(<tt>Boolean</tt>)</span> <span class="default"> </span> — <div class='inline'><p>Sort options</p> </div> </li> <li> <span class="name">:multiple</span> <span class="type">(<tt>Boolean</tt>)</span> <span class="default"> </span> — <div class='inline'><p>Allow multiple selections</p> </div> </li> <li> <span class="name">:case</span> <span class="type">(<tt><span class='object_link'><a href="../Symbol.html" title="Symbol (class)">Symbol</a></span></tt>)</span> <span class="default"> — default: <tt>:sensitive</tt>, <tt>:ignore</tt>, <tt>:smart</tt> </span> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="enter_text-class_method"> .<strong>enter_text</strong>(prompt, default_response: '') ⇒ <tt>Object</tt> </h3> </div> <div class="method_details "> <h3 class="signature " id="fzf-class_method"> .<strong>fzf</strong> ⇒ <tt>Object</tt> </h3> </div> <div class="method_details "> <h3 class="signature " id="install_fzf-class_method"> .<strong>install_fzf</strong> ⇒ <tt>Object</tt> </h3><div class="docstring"> <div class="discussion"> </div> </div> <div class="tags"> <p class="tag_title">Raises:</p> <ul class="raise"> <li> <span class='type'>(<tt>RuntimeError</tt>)</span> </li> </ul> </div> </div> <div class="method_details "> <h3 class="signature " id="yn-class_method"> .<strong>yn</strong>(question, default_response: false) ⇒ <tt>Bool</tt> </h3><div class="docstring"> <div class="discussion"> <p>Ask a yes or no question in the terminal</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>question</span> <span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span> — <div class='inline'><p>The question to ask</p> </div> </li> <li> <span class='name'>default_response</span> <span class='type'>(<tt>Bool</tt>)</span> <em class="default">(defaults to: <tt>false</tt>)</em> — <div class='inline'><p>default response if no input</p> </div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Bool</tt>)</span> — <div class='inline'><p>yes or no</p> </div> </li> </ul> </div> </div> </div> </div> <div id="footer"> Generated on Mon Dec 20 16:24:43 2021 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.26 (ruby-3.0.1). </div> </div> </body> </html>