<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
  Module: Doing::PromptChoose
  
    &mdash; Documentation by YARD 0.9.27
  
</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::PromptChoose";
  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> &raquo;
    <span class='title'><span class='object_link'><a href="../Doing.html" title="Doing (module)">Doing</a></span></span>
     &raquo; 
    <span class="title">PromptChoose</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::PromptChoose
  
  
  
</h1>
<div class="box_info">
  

  
  
  
  
  

  
  <dl>
    <dt>Included in:</dt>
    <dd><span class='object_link'><a href="Prompt.html" title="Doing::Prompt (module)">Prompt</a></span></dd>
  </dl>
  

  
  <dl>
    <dt>Defined in:</dt>
    <dd>lib/doing/prompt/choose.rb</dd>
  </dl>
  
</div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>Methods for creating interactive menus of options and items</p>


  </div>
</div>
<div class="tags">
  

</div>






  
    <h2>
      Instance 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-instance_method" title="#choose_from (instance method)">#<strong>choose_from</strong>(options, prompt: &#39;Make a selection: &#39;, multiple: false, sorted: true, fzf_args: [])  &#x21d2; 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-instance_method" title="#choose_from_items (instance method)">#<strong>choose_from_items</strong>(items, **opt)  &#x21d2; 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>

      
    </ul>
  



  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="choose_from-instance_method">
  
    #<strong>choose_from</strong>(options, prompt: &#39;Make a selection: &#39;, multiple: false, sorted: true, fzf_args: [])  &#x21d2; <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">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>options</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The options from which to choose</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>
      
      
        <em class="default">(defaults to: <tt>&#39;Make a selection: &#39;</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>The prompt</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>multiple</span>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>false</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>If true, allow multiple selections</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>sorted</span>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>true</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>If true, sort selections alphanumerically</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>fzf_args</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span></tt>)</span>
      
      
        <em class="default">(defaults to: <tt>[]</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>Additional fzf arguments</p>
</div>
      
    </li>
  
</ul>

<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>
      
      
      
        &mdash;
        <div class='inline'><p>The selected option</p>
</div>
      
    </li>
  
</ul>

</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="choose_from_items-instance_method">
  
    #<strong>choose_from_items</strong>(items, **opt)  &#x21d2; <tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></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>
      
      
      
        &mdash;
        <div class='inline'><p>list of items</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>opt</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <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>
          
            &mdash; <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>
          
            &mdash; <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>
          
            &mdash; <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>
          
            &mdash; <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>
          
            &mdash; <div class='inline'><p>Show menu even if there&#39;s only one option</p>
</div>
          
        </li>
      
        <li>
          <span class="name">:menu</span>
          <span class="type">(<tt>Boolean</tt>)</span>
          <span class="default">
            
          </span>
          
            &mdash; <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>
          
            &mdash; <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>
          
            &mdash; <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">
            
              &mdash; default:
              <tt>:sensitive</tt>, <tt>:ignore</tt>, <tt>:smart</tt>
            
          </span>
          
        </li>
      
    </ul>
  


</div>
</div>
    
  </div>

</div>

      <div id="footer">
  Generated on Wed May 11 10:25:19 2022 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.9.27 (ruby-3.0.1).
</div>

    </div>
  </body>
</html>