<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Class: Lazier::Settings — Documentation by YARD 0.8.3 </title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" /> <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> hasFrames = window.top.frames.main ? true : false; relpath = '../'; framesUrl = "../frames.html#!" + escape(window.location.href); </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 id="header"> <div id="menu"> <a href="../_index.html">Index (S)</a> » <span class='title'><span class='object_link'><a href="../Lazier.html" title="Lazier (module)">Lazier</a></span></span> » <span class="title">Settings</span> <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> </div> <div id="search"> <a class="full_list_link" id="class_list_link" href="../class_list.html"> Class List </a> <a class="full_list_link" id="method_list_link" href="../method_list.html"> Method List </a> <a class="full_list_link" id="file_list_link" href="../file_list.html"> File List </a> </div> <div class="clear"></div> </div> <iframe id="search_frame"></iframe> <div id="content"><h1>Class: Lazier::Settings </h1> <dl class="box"> <dt class="r1">Inherits:</dt> <dd class="r1"> <span class="inheritName">Object</span> <ul class="fullTree"> <li>Object</li> <li class="next">Lazier::Settings</li> </ul> <a href="#" class="inheritanceTree">show all</a> </dd> <dt class="r2 last">Defined in:</dt> <dd class="r2 last">lib/lazier/settings.rb</dd> </dl> <div class="clear"></div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>Settings for the extensions.</p> </div> </div> <div class="tags"> </div> <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="#boolean_names-instance_method" title="#boolean_names (instance method)">- (Hash) <strong>boolean_names</strong> </a> </span> <span class="summary_desc"><div class='inline'><p>String representations of booleans.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#date_formats-instance_method" title="#date_formats (instance method)">- (Hash) <strong>date_formats</strong> </a> </span> <span class="summary_desc"><div class='inline'><p>Custom date and time formats.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#date_names-instance_method" title="#date_names (instance method)">- (Hash) <strong>date_names</strong> </a> </span> <span class="summary_desc"><div class='inline'><p>String representations of days and months.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#format_number-instance_method" title="#format_number (instance method)">- (Hash) <strong>format_number</strong> </a> </span> <span class="summary_desc"><div class='inline'><p>Settings for numbers formatting.</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)">+ (Settings) <strong>instance</strong> </a> </span> <span class="summary_desc"><div class='inline'><p>Returns the singleton instance of the settings.</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)">- (Settings) <strong>initialize</strong> </a> </span> <span class="note title constructor">constructor</span> <span class="summary_desc"><div class='inline'><p>Initializes a new settings object.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#setup_boolean_names-instance_method" title="#setup_boolean_names (instance method)">- (Hash) <strong>setup_boolean_names</strong>(true_name = nil, false_name = nil) </a> </span> <span class="summary_desc"><div class='inline'><p>Setups strings representation of booleans.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#setup_date_formats-instance_method" title="#setup_date_formats (instance method)">- (Hash) <strong>setup_date_formats</strong>(formats = nil, replace = false) </a> </span> <span class="summary_desc"><div class='inline'><p>Setups custom formats for dates and times.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#setup_date_names-instance_method" title="#setup_date_names (instance method)">- (Hash) <strong>setup_date_names</strong>(long_months = nil, short_months = nil, long_days = nil, short_days = nil) </a> </span> <span class="summary_desc"><div class='inline'><p>Setups strings representation of days and months.</p> </div></span> </li> <li class="public "> <span class="summary_signature"> <a href="#setup_format_number-instance_method" title="#setup_format_number (instance method)">- (Hash) <strong>setup_format_number</strong>(prec = 2, decimal_separator = ".", add_string = "", k_separator = ",") </a> </span> <span class="summary_desc"><div class='inline'><p>Setups formatters for a number.</p> </div></span> </li> </ul> <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"> - (<tt><span class='object_link'><a href="" title="Lazier::Settings (class)">Settings</a></span></tt>) <strong>initialize</strong> </h3><div class="docstring"> <div class="discussion"> <p>Initializes a new settings object.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 28 29 30 31 32 33</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 28</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_setup_format_number'>setup_format_number</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_setup_boolean_names'>setup_boolean_names</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_setup_date_formats'>setup_date_formats</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_setup_date_names'>setup_date_names</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="boolean_names=-instance_method"></span> <div class="method_details first"> <h3 class="signature first" id="boolean_names-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>boolean_names</strong> </h3><div class="docstring"> <div class="discussion"> <p>String representations of booleans.</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="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>the current value of boolean_names</p> </div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 14 15 16</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 14</span> <span class='kw'>def</span> <span class='id identifier rubyid_boolean_names'>boolean_names</span> <span class='ivar'>@boolean_names</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="date_formats=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="date_formats-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>date_formats</strong> </h3><div class="docstring"> <div class="discussion"> <p>Custom date and time formats.</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="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>the current value of date_formats</p> </div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 14 15 16</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 14</span> <span class='kw'>def</span> <span class='id identifier rubyid_date_formats'>date_formats</span> <span class='ivar'>@date_formats</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="date_names=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="date_names-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>date_names</strong> </h3><div class="docstring"> <div class="discussion"> <p>String representations of days and months.</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="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>the current value of date_names</p> </div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 14 15 16</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 14</span> <span class='kw'>def</span> <span class='id identifier rubyid_date_names'>date_names</span> <span class='ivar'>@date_names</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <span id="format_number=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="format_number-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>format_number</strong> </h3><div class="docstring"> <div class="discussion"> <p>Settings for numbers formatting.</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="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>the current value of format_number</p> </div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 14 15 16</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 14</span> <span class='kw'>def</span> <span class='id identifier rubyid_format_number'>format_number</span> <span class='ivar'>@format_number</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"> + (<tt><span class='object_link'><a href="" title="Lazier::Settings (class)">Settings</a></span></tt>) <strong>instance</strong> </h3><div class="docstring"> <div class="discussion"> <p>Returns the singleton instance of the settings.</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="Lazier::Settings (class)">Settings</a></span></tt>)</span> — <div class='inline'><p>The singleton instance of the settings.</p> </div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 23 24 25</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 23</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='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</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="setup_boolean_names-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>setup_boolean_names</strong>(true_name = nil, false_name = nil) </h3><div class="docstring"> <div class="discussion"> <p>Setups strings representation of booleans.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>true_name</span> <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The string representation of <code>true</code>. Defaults to <code>Yes</code>.</p> </div> </li> <li> <span class='name'>false_name</span> <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The string representation of <code>false</code>. Defaults to <code>No</code>.</p> </div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>The new representations.</p> </div> </li> </ul> <p class="tag_title">See Also:</p> <ul class="see"> <li><span class='object_link'><a href="Object.html#format_boolean-instance_method" title="Lazier::Object#format_boolean (method)">Object#format_boolean</a></span></li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 53 54 55 56 57</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 53</span> <span class='kw'>def</span> <span class='id identifier rubyid_setup_boolean_names'>setup_boolean_names</span><span class='lparen'>(</span><span class='id identifier rubyid_true_name'>true_name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_false_name'>false_name</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='id identifier rubyid_true_name'>true_name</span> <span class='op'>||=</span> <span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_boolean'>boolean</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='id identifier rubyid_false_name'>false_name</span> <span class='op'>||=</span> <span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_boolean'>boolean</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='ivar'>@boolean_names</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='kw'>true</span> <span class='op'>=></span> <span class='id identifier rubyid_true_name'>true_name</span><span class='comma'>,</span> <span class='kw'>false</span> <span class='op'>=></span> <span class='id identifier rubyid_false_name'>false_name</span><span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="setup_date_formats-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>setup_date_formats</strong>(formats = nil, replace = false) </h3><div class="docstring"> <div class="discussion"> <p>Setups custom formats for dates and times.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>formats</span> <span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The format to add or replace.</p> </div> </li> <li> <span class='name'>replace</span> <span class='type'>(<tt><span class='object_link'><a href="Boolean.html" title="Lazier::Boolean (module)">Boolean</a></span></tt>)</span> <em class="default">(defaults to: <tt>false</tt>)</em> — <div class='inline'><p>If to discard current formats.</p> </div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>The new formats.</p> </div> </li> </ul> <p class="tag_title">See Also:</p> <ul class="see"> <li><span class='object_link'><a href="DateTime.html#lstrftime-instance_method" title="Lazier::DateTime#lstrftime (method)">DateTime#lstrftime</a></span></li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 65</span> <span class='kw'>def</span> <span class='id identifier rubyid_setup_date_formats'>setup_date_formats</span><span class='lparen'>(</span><span class='id identifier rubyid_formats'>formats</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_replace'>replace</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span> <span class='id identifier rubyid_formats'>formats</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>ct_date:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%Y-%m-%d</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>ct_time:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%H:%M:%S</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>ct_date_time:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%F %T</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>ct_iso_8601:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%FT%T%z</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_formats'>formats</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='kw'>if</span> <span class='id identifier rubyid_formats'>formats</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_replace'>replace</span> <span class='kw'>then</span> <span class='ivar'>@date_formats</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='ivar'>@date_formats</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_formats'>formats</span><span class='rparen'>)</span> <span class='kw'>else</span> <span class='ivar'>@date_formats</span> <span class='op'>=</span> <span class='id identifier rubyid_formats'>formats</span> <span class='kw'>end</span> <span class='ivar'>@date_formats</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='op'>::</span><span class='const'>Time</span><span class='op'>::</span><span class='const'>DATE_FORMATS</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='ivar'>@date_formats</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="setup_date_names-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>setup_date_names</strong>(long_months = nil, short_months = nil, long_days = nil, short_days = nil) </h3><div class="docstring"> <div class="discussion"> <p>Setups strings representation of days and months.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>long_months</span> <span class='type'>(<tt>Array</tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The string representation of months.</p> </div> </li> <li> <span class='name'>short_months</span> <span class='type'>(<tt>Array</tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The abbreviated string representation of months.</p> </div> </li> <li> <span class='name'>long_days</span> <span class='type'>(<tt>Array</tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The string representation of days.</p> </div> </li> <li> <span class='name'>short_days</span> <span class='type'>(<tt>Array</tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The abbreviated string representation of days.</p> </div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>The new representations.</p> </div> </li> </ul> <p class="tag_title">See Also:</p> <ul class="see"> <li><span class='object_link'><a href="DateTime/ClassMethods.html#days-instance_method" title="Lazier::DateTime::ClassMethods#days (method)">DateTime::ClassMethods#days</a></span></li> <li><span class='object_link'><a href="DateTime/ClassMethods.html#months-instance_method" title="Lazier::DateTime::ClassMethods#months (method)">DateTime::ClassMethods#months</a></span></li> <li><span class='object_link'><a href="DateTime.html#lstrftime-instance_method" title="Lazier::DateTime#lstrftime (method)">DateTime#lstrftime</a></span></li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 92 93 94 95 96 97 98 99</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 92</span> <span class='kw'>def</span> <span class='id identifier rubyid_setup_date_names'>setup_date_names</span><span class='lparen'>(</span><span class='id identifier rubyid_long_months'>long_months</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_short_months'>short_months</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_long_days'>long_days</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_short_days'>short_days</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='id identifier rubyid_long_months'>long_months</span> <span class='op'>=</span> <span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_long_months'>long_months</span> <span class='kw'>if</span> <span class='id identifier rubyid_long_months'>long_months</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='id identifier rubyid_short_months'>short_months</span> <span class='op'>=</span> <span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_short_months'>short_months</span> <span class='kw'>if</span> <span class='id identifier rubyid_short_months'>short_months</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='id identifier rubyid_long_days'>long_days</span> <span class='op'>=</span> <span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_long_days'>long_days</span> <span class='kw'>if</span> <span class='id identifier rubyid_long_days'>long_days</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='id identifier rubyid_short_days'>short_days</span> <span class='op'>=</span> <span class='const'>Lazier</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_date'>date</span><span class='period'>.</span><span class='id identifier rubyid_short_days'>short_days</span> <span class='kw'>if</span> <span class='id identifier rubyid_short_days'>short_days</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='ivar'>@date_names</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>long_months:</span> <span class='id identifier rubyid_long_months'>long_months</span><span class='comma'>,</span> <span class='label'>short_months:</span> <span class='id identifier rubyid_short_months'>short_months</span><span class='comma'>,</span> <span class='label'>long_days:</span> <span class='id identifier rubyid_long_days'>long_days</span><span class='comma'>,</span> <span class='label'>short_days:</span> <span class='id identifier rubyid_short_days'>short_days</span> <span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="setup_format_number-instance_method"> - (<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>) <strong>setup_format_number</strong>(prec = 2, decimal_separator = ".", add_string = "", k_separator = ",") </h3><div class="docstring"> <div class="discussion"> <p>Setups formatters for a number.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>prec</span> <span class='type'>(<tt>Fixnum</tt>)</span> <em class="default">(defaults to: <tt>2</tt>)</em> — <div class='inline'><p>The precision to show.</p> </div> </li> <li> <span class='name'>decimal_separator</span> <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span> <em class="default">(defaults to: <tt>"."</tt>)</em> — <div class='inline'><p>The string to use as decimal separator.</p> </div> </li> <li> <span class='name'>add_string</span> <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span> <em class="default">(defaults to: <tt>""</tt>)</em> — <div class='inline'><p>The string to append to the number.</p> </div> </li> <li> <span class='name'>k_separator</span> <span class='type'>(<tt><span class='object_link'><a href="String.html" title="Lazier::String (module)">String</a></span></tt>)</span> <em class="default">(defaults to: <tt>","</tt>)</em> — <div class='inline'><p>The string to use as thousands separator.</p> </div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="Hash.html" title="Lazier::Hash (module)">Hash</a></span></tt>)</span> — <div class='inline'><p>The new formatters.</p> </div> </li> </ul> <p class="tag_title">See Also:</p> <ul class="see"> <li><span class='object_link'><a href="Object.html#format_number-instance_method" title="Lazier::Object#format_number (method)">Object#format_number</a></span></li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 43 44 45</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/lazier/settings.rb', line 43</span> <span class='kw'>def</span> <span class='id identifier rubyid_setup_format_number'>setup_format_number</span><span class='lparen'>(</span><span class='id identifier rubyid_prec'>prec</span> <span class='op'>=</span> <span class='int'>2</span><span class='comma'>,</span> <span class='id identifier rubyid_decimal_separator'>decimal_separator</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_add_string'>add_string</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_k_separator'>k_separator</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='ivar'>@format_number</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>prec:</span> <span class='id identifier rubyid_prec'>prec</span><span class='comma'>,</span> <span class='label'>decimal_separator:</span> <span class='id identifier rubyid_decimal_separator'>decimal_separator</span><span class='comma'>,</span> <span class='label'>add_string:</span> <span class='id identifier rubyid_add_string'>add_string</span><span class='comma'>,</span> <span class='label'>k_separator:</span> <span class='id identifier rubyid_k_separator'>k_separator</span><span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> </div> <div id="footer"> Generated on Tue Jan 29 08:17:35 2013 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.8.3 (ruby-1.9.3). </div> </body> </html>