ShogunPanda/bovem

View on GitHub
docs/Bovem/Console.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
  Class: Bovem::Console
  
    &mdash; Documentation by YARD 0.9.7
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  pathId = "Bovem::Console";
  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 (C)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span>
     &raquo; 
    <span class="title">Console</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>Class: Bovem::Console
  
  
  
</h1>
<div class="box_info">
  
  <dl>
    <dt>Inherits:</dt>
    <dd>
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Bovem::Console</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
    </dd>
  </dl>
  

  
  
  
  
  <dl>
      <dt>Includes:</dt>
      <dd><span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Bovem::ConsoleMethods::Interactions</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Bovem::ConsoleMethods::Logging</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Bovem::ConsoleMethods::Output</a></span>, <span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">Bovem::ConsoleMethods::StyleHandling</a></span></dd>
  </dl>
  
  

  

  
  <dl>
    <dt>Defined in:</dt>
    <dd>lib/bovem/console.rb</dd>
  </dl>
  
</div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>This is a text utility wrapper console I/O.</p>


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

</div>


  <h2>Constant Summary</h2>
  
  <h3 class="inherited">Constants included
     from <span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Bovem::ConsoleMethods::Logging</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="ConsoleMethods/Logging.html#DEFAULT_STATUSES-constant" title="Bovem::ConsoleMethods::Logging::DEFAULT_STATUSES (constant)">Bovem::ConsoleMethods::Logging::DEFAULT_STATUSES</a></span></p>


  <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#i18n-instance_method" title="#i18n (instance method)">#<strong>i18n</strong>  &#x21d2; I18n </a>
    

    
  </span>
  
  
  
    
      <span class="note title readonly">readonly</span>
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>A i18n helper.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#indentation-instance_method" title="#indentation (instance method)">#<strong>indentation</strong>  &#x21d2; Fixnum </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Current indentation width.</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#indentation_string-instance_method" title="#indentation_string (instance method)">#<strong>indentation_string</strong>  &#x21d2; String </a>
    

    
  </span>
  
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>The string used for indentation.</p>
</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="#instance-class_method" title="instance (class method)">.<strong>instance</strong>  &#x21d2; Console </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Returns a unique instance for Console.</p>
</div></span>
  
</li>

      
    </ul>
  
    <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="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>  &#x21d2; Console </a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Initializes a new Console.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#line_width-instance_method" title="#line_width (instance method)">#<strong>line_width</strong>  &#x21d2; Fixnum </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Get the width of the terminal.</p>
</div></span>
  
</li>

      
    </ul>
  


  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Bovem::ConsoleMethods::Interactions</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="ConsoleMethods/Interactions.html#read-instance_method" title="Bovem::ConsoleMethods::Interactions#read (method)">#read</a></span>, <span class='object_link'><a href="ConsoleMethods/Interactions.html#task-instance_method" title="Bovem::ConsoleMethods::Interactions#task (method)">#task</a></span></p>

  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Bovem::ConsoleMethods::Logging</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="ConsoleMethods/Logging.html#begin-instance_method" title="Bovem::ConsoleMethods::Logging#begin (method)">#begin</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#debug-instance_method" title="Bovem::ConsoleMethods::Logging#debug (method)">#debug</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#error-instance_method" title="Bovem::ConsoleMethods::Logging#error (method)">#error</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#fatal-instance_method" title="Bovem::ConsoleMethods::Logging#fatal (method)">#fatal</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#get_banner-instance_method" title="Bovem::ConsoleMethods::Logging#get_banner (method)">#get_banner</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#info-instance_method" title="Bovem::ConsoleMethods::Logging#info (method)">#info</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#progress-instance_method" title="Bovem::ConsoleMethods::Logging#progress (method)">#progress</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#status-instance_method" title="Bovem::ConsoleMethods::Logging#status (method)">#status</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#warn-instance_method" title="Bovem::ConsoleMethods::Logging#warn (method)">#warn</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#write-instance_method" title="Bovem::ConsoleMethods::Logging#write (method)">#write</a></span>, <span class='object_link'><a href="ConsoleMethods/Logging.html#write_banner_aligned-instance_method" title="Bovem::ConsoleMethods::Logging#write_banner_aligned (method)">#write_banner_aligned</a></span></p>

  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Bovem::ConsoleMethods::Output</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="ConsoleMethods/Output.html#emphasize-instance_method" title="Bovem::ConsoleMethods::Output#emphasize (method)">#emphasize</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html#format-instance_method" title="Bovem::ConsoleMethods::Output#format (method)">#format</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html#format_right-instance_method" title="Bovem::ConsoleMethods::Output#format_right (method)">#format_right</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html#indent-instance_method" title="Bovem::ConsoleMethods::Output#indent (method)">#indent</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html#reset_indentation-instance_method" title="Bovem::ConsoleMethods::Output#reset_indentation (method)">#reset_indentation</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html#set_indentation-instance_method" title="Bovem::ConsoleMethods::Output#set_indentation (method)">#set_indentation</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html#with_indentation-instance_method" title="Bovem::ConsoleMethods::Output#with_indentation (method)">#with_indentation</a></span>, <span class='object_link'><a href="ConsoleMethods/Output.html#wrap-instance_method" title="Bovem::ConsoleMethods::Output#wrap (method)">#wrap</a></span></p>

  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">Bovem::ConsoleMethods::StyleHandling</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="ConsoleMethods/StyleHandling.html#replace_markers-instance_method" title="Bovem::ConsoleMethods::StyleHandling#replace_markers (method)">#replace_markers</a></span></p>

  <div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <h3 class="signature first" id="initialize-instance_method">
  
    #<strong>initialize</strong>  &#x21d2; <tt><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Initializes a new Console.</p>


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

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


706
707
708
709
710</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 706</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
  <span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
  <span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span>
  <span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html" title="Bovem::Application (class)">Application</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html#LOCALE_ROOT-constant" title="Bovem::Application::LOCALE_ROOT (constant)">LOCALE_ROOT</a></span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id=""></span>
      <div class="method_details first">
  <h3 class="signature first" id="i18n-instance_method">
  
    #<strong>i18n</strong>  &#x21d2; <tt><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></tt>  <span class="extras">(readonly)</span>
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns A i18n helper.</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="I18n.html" title="Bovem::I18n (class)">I18n</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>A i18n helper.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 689</span>

<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></span>
  <span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span><span class='comma'>,</span> <span class='symbol'>:indentation_string</span>
  <span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:i18n</span>

  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">StyleHandling</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Output</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Logging</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Interactions</a></span></span>

  <span class='comment'># Returns a unique instance for Console.
</span>  <span class='comment'>#
</span>  <span class='comment'># @return [Console] A new instance.
</span>  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
    <span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Bovem::Console#initialize (method)">new</a></span></span>
  <span class='kw'>end</span>

  <span class='comment'># Initializes a new Console.
</span>  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
    <span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
    <span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span>
    <span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html" title="Bovem::Application (class)">Application</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html#LOCALE_ROOT-constant" title="Bovem::Application::LOCALE_ROOT (constant)">LOCALE_ROOT</a></span></span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='comment'># Get the width of the terminal.
</span>  <span class='comment'>#
</span>  <span class='comment'># @return [Fixnum] The current width of the terminal. If not possible to retrieve the width, it returns `80.
</span>  <span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
    <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>io/console</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
    <span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
  <span class='kw'>rescue</span>
    <span class='int'>80</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="indentation=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="indentation-instance_method">
  
    #<strong>indentation</strong>  &#x21d2; <tt>Fixnum</tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns Current indentation width.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Fixnum</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>Current indentation width.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 689</span>

<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></span>
  <span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span><span class='comma'>,</span> <span class='symbol'>:indentation_string</span>
  <span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:i18n</span>

  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">StyleHandling</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Output</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Logging</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Interactions</a></span></span>

  <span class='comment'># Returns a unique instance for Console.
</span>  <span class='comment'>#
</span>  <span class='comment'># @return [Console] A new instance.
</span>  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
    <span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Bovem::Console#initialize (method)">new</a></span></span>
  <span class='kw'>end</span>

  <span class='comment'># Initializes a new Console.
</span>  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
    <span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
    <span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span>
    <span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html" title="Bovem::Application (class)">Application</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html#LOCALE_ROOT-constant" title="Bovem::Application::LOCALE_ROOT (constant)">LOCALE_ROOT</a></span></span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='comment'># Get the width of the terminal.
</span>  <span class='comment'>#
</span>  <span class='comment'># @return [Fixnum] The current width of the terminal. If not possible to retrieve the width, it returns `80.
</span>  <span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
    <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>io/console</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
    <span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
  <span class='kw'>rescue</span>
    <span class='int'>80</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="indentation_string=-instance_method"></span>
      <div class="method_details ">
  <h3 class="signature " id="indentation_string-instance_method">
  
    #<strong>indentation_string</strong>  &#x21d2; <tt>String</tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns The string used for indentation.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The string used for indentation.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 689</span>

<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></span>
  <span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:indentation</span><span class='comma'>,</span> <span class='symbol'>:indentation_string</span>
  <span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='symbol'>:i18n</span>

  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/StyleHandling.html" title="Bovem::ConsoleMethods::StyleHandling (module)">StyleHandling</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Output.html" title="Bovem::ConsoleMethods::Output (module)">Output</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Logging.html" title="Bovem::ConsoleMethods::Logging (module)">Logging</a></span></span>
  <span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods.html" title="Bovem::ConsoleMethods (module)">ConsoleMethods</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ConsoleMethods/Interactions.html" title="Bovem::ConsoleMethods::Interactions (module)">Interactions</a></span></span>

  <span class='comment'># Returns a unique instance for Console.
</span>  <span class='comment'>#
</span>  <span class='comment'># @return [Console] A new instance.
</span>  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
    <span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Bovem::Console#initialize (method)">new</a></span></span>
  <span class='kw'>end</span>

  <span class='comment'># Initializes a new Console.
</span>  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
    <span class='ivar'>@indentation</span> <span class='op'>=</span> <span class='int'>0</span>
    <span class='ivar'>@indentation_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span>
    <span class='ivar'>@i18n</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="I18n.html" title="Bovem::I18n (class)">I18n</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>root:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bovem.console</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>path:</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html" title="Bovem::Application (class)">Application</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Application.html#LOCALE_ROOT-constant" title="Bovem::Application::LOCALE_ROOT (constant)">LOCALE_ROOT</a></span></span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='comment'># Get the width of the terminal.
</span>  <span class='comment'>#
</span>  <span class='comment'># @return [Fixnum] The current width of the terminal. If not possible to retrieve the width, it returns `80.
</span>  <span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
    <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>io/console</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
    <span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
  <span class='kw'>rescue</span>
    <span class='int'>80</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</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="instance-class_method">
  
    .<strong>instance</strong>  &#x21d2; <tt><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Returns a unique instance for Console.</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="" title="Bovem::Console (class)">Console</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>A new instance.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


701
702
703</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 701</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
  <span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="../Bovem.html" title="Bovem (module)">Bovem</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Bovem::Console (class)">Console</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Bovem::Console#initialize (method)">new</a></span></span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

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

    
      <div class="method_details first">
  <h3 class="signature first" id="line_width-instance_method">
  
    #<strong>line_width</strong>  &#x21d2; <tt>Fixnum</tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Get the width of the terminal.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Fixnum</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The current width of the terminal. If not possible to retrieve the width, it returns `80.</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


715
716
717
718
719
720</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/bovem/console.rb', line 715</span>

<span class='kw'>def</span> <span class='id identifier rubyid_line_width'>line_width</span>
  <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>io/console</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='rparen'>)</span>
  <span class='gvar'>$stdin</span><span class='period'>.</span><span class='id identifier rubyid_winsize'>winsize</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
<span class='kw'>rescue</span>
  <span class='int'>80</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

      <div id="footer">
  Generated on Thu Jan 12 16:11:01 2017 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.9.7 (ruby-2.3.0).
</div>

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