CINXE.COM

Numeric

<!DOCTYPE html> <html lang="en"> <head> <title>Numeric</title> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../css/panel.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" /> <script src="../js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script> <script src="../js/main.js" type="text/javascript" charset="utf-8"></script> <script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script> <script src="../js/turbolinks.js" type="text/javascript" charset="utf-8"></script> <script src="../js/search_index.js" type="text/javascript" charset="utf-8"></script> <script src="../js/searcher.js" type="text/javascript" charset="utf-8"></script> <script src="../panel/tree.js" type="text/javascript" charset="utf-8"></script> <script src="../js/searchdoc.js" type="text/javascript" charset="utf-8"></script> <meta name="data-rel-prefix" content="../"> <meta name="data-tree-keys" content='["Numeric"]'> <meta property="og:title" value="Numeric"> <meta name="keywords" content="Numeric class, bytes, byte, kilobytes, kilobyte, megabytes, megabyte, gigabytes, gigabyte, terabytes, terabyte, petabytes, petabyte, exabytes, exabyte, zettabytes, zettabyte, seconds, second, minutes, minute, hours, hour, days, day, weeks, week, fortnights, fortnight, in_milliseconds, html_safe?"> </head> <body> <a class="sr-only sr-only-focusable" href="#content" data-turbolinks="false">Skip to Content</a> <a class="sr-only sr-only-focusable" href="#search" data-turbolinks="false">Skip to Search</a> <input type="checkbox" id="hamburger" class="panel_checkbox"> <label class="panel_mobile_button" for="hamburger"><span></span> Menu</label> <nav class="panel panel_tree" id="panel" data-turbolinks-permanent> <div class="header"> <input type="text" placeholder="Search (/) for a class, method, ..." autosave="searchdoc" results="10" id="search" autocomplete="off" tabindex="-1" /> <label class="panel_mobile_button_close" for="hamburger"><span></span> Close</label> </div> <div class="tree"> <ul> </ul> </div> <div class="result"> <ul> </ul> </div> <a href="links.html" id="links">index</a> </nav> <div class="banner"> <span>Ruby on Rails 8.0.0</span><br /> <h2> <span class="type">Class</span> Numeric <span class="parent">&lt; <a href="Object.html">Object</a> </span> </h2> <ul class="files"> <li><a href="../files/activesupport/lib/active_support/core_ext/numeric/bytes_rb.html">activesupport/lib/active_support/core_ext/numeric/bytes.rb</a></li> <li><a href="../files/activesupport/lib/active_support/core_ext/numeric/time_rb.html">activesupport/lib/active_support/core_ext/numeric/time.rb</a></li> <li><a href="../files/activesupport/lib/active_support/core_ext/object/blank_rb.html">activesupport/lib/active_support/core_ext/object/blank.rb</a></li> <li><a href="../files/activesupport/lib/active_support/core_ext/object/json_rb.html">activesupport/lib/active_support/core_ext/object/json.rb</a></li> <li><a href="../files/activesupport/lib/active_support/core_ext/string/output_safety_rb.html">activesupport/lib/active_support/core_ext/string/output_safety.rb</a></li> </ul> <div id="version-badge">v8.0.0</div> </div> <main id="bodyContent"> <div id="content"> <!-- Method ref --> <div class="sectiontitle">Methods</div> <dl class="methods"> <dt>B</dt> <dd> <ul> <li> <a href="#method-i-byte">byte</a>, </li> <li> <a href="#method-i-bytes">bytes</a> </li> </ul> </dd> <dt>D</dt> <dd> <ul> <li> <a href="#method-i-day">day</a>, </li> <li> <a href="#method-i-days">days</a> </li> </ul> </dd> <dt>E</dt> <dd> <ul> <li> <a href="#method-i-exabyte">exabyte</a>, </li> <li> <a href="#method-i-exabytes">exabytes</a> </li> </ul> </dd> <dt>F</dt> <dd> <ul> <li> <a href="#method-i-fortnight">fortnight</a>, </li> <li> <a href="#method-i-fortnights">fortnights</a> </li> </ul> </dd> <dt>G</dt> <dd> <ul> <li> <a href="#method-i-gigabyte">gigabyte</a>, </li> <li> <a href="#method-i-gigabytes">gigabytes</a> </li> </ul> </dd> <dt>H</dt> <dd> <ul> <li> <a href="#method-i-hour">hour</a>, </li> <li> <a href="#method-i-hours">hours</a>, </li> <li> <a href="#method-i-html_safe-3F">html_safe?</a> </li> </ul> </dd> <dt>I</dt> <dd> <ul> <li> <a href="#method-i-in_milliseconds">in_milliseconds</a> </li> </ul> </dd> <dt>K</dt> <dd> <ul> <li> <a href="#method-i-kilobyte">kilobyte</a>, </li> <li> <a href="#method-i-kilobytes">kilobytes</a> </li> </ul> </dd> <dt>M</dt> <dd> <ul> <li> <a href="#method-i-megabyte">megabyte</a>, </li> <li> <a href="#method-i-megabytes">megabytes</a>, </li> <li> <a href="#method-i-minute">minute</a>, </li> <li> <a href="#method-i-minutes">minutes</a> </li> </ul> </dd> <dt>P</dt> <dd> <ul> <li> <a href="#method-i-petabyte">petabyte</a>, </li> <li> <a href="#method-i-petabytes">petabytes</a> </li> </ul> </dd> <dt>S</dt> <dd> <ul> <li> <a href="#method-i-second">second</a>, </li> <li> <a href="#method-i-seconds">seconds</a> </li> </ul> </dd> <dt>T</dt> <dd> <ul> <li> <a href="#method-i-terabyte">terabyte</a>, </li> <li> <a href="#method-i-terabytes">terabytes</a> </li> </ul> </dd> <dt>W</dt> <dd> <ul> <li> <a href="#method-i-week">week</a>, </li> <li> <a href="#method-i-weeks">weeks</a> </li> </ul> </dd> <dt>Z</dt> <dd> <ul> <li> <a href="#method-i-zettabyte">zettabyte</a>, </li> <li> <a href="#method-i-zettabytes">zettabytes</a> </li> </ul> </dd> </dl> <!-- Section constants --> <h2 class="sectiontitle">Constants</h2> <table border='0' cellpadding='5'> <tr valign='top'> <td class="attr-name">EXABYTE</td> <td>=</td> <td class="attr-value">PETABYTE * 1024</td> </tr> <tr valign='top'> <td>&nbsp;</td> <td colspan="2" class="attr-desc"></td> </tr> <tr valign='top'> <td class="attr-name">GIGABYTE</td> <td>=</td> <td class="attr-value">MEGABYTE * 1024</td> </tr> <tr valign='top'> <td>&nbsp;</td> <td colspan="2" class="attr-desc"></td> </tr> <tr valign='top'> <td class="attr-name">KILOBYTE</td> <td>=</td> <td class="attr-value">1024</td> </tr> <tr valign='top'> <td>&nbsp;</td> <td colspan="2" class="attr-desc"></td> </tr> <tr valign='top'> <td class="attr-name">MEGABYTE</td> <td>=</td> <td class="attr-value">KILOBYTE * 1024</td> </tr> <tr valign='top'> <td>&nbsp;</td> <td colspan="2" class="attr-desc"></td> </tr> <tr valign='top'> <td class="attr-name">PETABYTE</td> <td>=</td> <td class="attr-value">TERABYTE * 1024</td> </tr> <tr valign='top'> <td>&nbsp;</td> <td colspan="2" class="attr-desc"></td> </tr> <tr valign='top'> <td class="attr-name">TERABYTE</td> <td>=</td> <td class="attr-value">GIGABYTE * 1024</td> </tr> <tr valign='top'> <td>&nbsp;</td> <td colspan="2" class="attr-desc"></td> </tr> <tr valign='top'> <td class="attr-name">ZETTABYTE</td> <td>=</td> <td class="attr-value">EXABYTE * 1024</td> </tr> <tr valign='top'> <td>&nbsp;</td> <td colspan="2" class="attr-desc"></td> </tr> </table> <!-- Methods --> <h2 class="sectiontitle">Instance Public methods</h2> <div class="method"> <h3 class="title method-title" id="method-i-byte"> <b>byte</b>() <a href="../classes/Numeric.html#method-i-byte" name="method-i-byte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-bytes">bytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-bytes"> <b>bytes</b>() <a href="../classes/Numeric.html#method-i-bytes" name="method-i-bytes" class="permalink">Link</a> </h3> <div class="description"> <p>Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes</p> <pre><code>2.bytes # =&gt; 2 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-byte">byte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-bytes_source')" id="l_method-i-bytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L15" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-bytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 15</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bytes</span> <span class="ruby-keyword">self</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-day"> <b>day</b>() <a href="../classes/Numeric.html#method-i-day" name="method-i-day" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-days">days</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-days"> <b>days</b>() <a href="../classes/Numeric.html#method-i-days" name="method-i-days" class="permalink">Link</a> </h3> <div class="description"> <p>Returns a Duration instance matching the number of days provided.</p> <pre><code>2.days # =&gt; 2 days </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-day">day</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-days_source')" id="l_method-i-days_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/time.rb#L37" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-days_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/time.rb, line 37</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">days</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Duration</span>.<span class="ruby-identifier">days</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-exabyte"> <b>exabyte</b>() <a href="../classes/Numeric.html#method-i-exabyte" name="method-i-exabyte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-exabytes">exabytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-exabytes"> <b>exabytes</b>() <a href="../classes/Numeric.html#method-i-exabytes" name="method-i-exabytes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of bytes equivalent to the exabytes provided.</p> <pre><code>2.exabytes # =&gt; 2_305_843_009_213_693_952 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-exabyte">exabyte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-exabytes_source')" id="l_method-i-exabytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L63" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-exabytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 63</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">exabytes</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-constant">EXABYTE</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-fortnight"> <b>fortnight</b>() <a href="../classes/Numeric.html#method-i-fortnight" name="method-i-fortnight" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-fortnights">fortnights</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-fortnights"> <b>fortnights</b>() <a href="../classes/Numeric.html#method-i-fortnights" name="method-i-fortnights" class="permalink">Link</a> </h3> <div class="description"> <p>Returns a Duration instance matching the number of fortnights provided.</p> <pre><code>2.fortnights # =&gt; 4 weeks </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-fortnight">fortnight</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-fortnights_source')" id="l_method-i-fortnights_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/time.rb#L53" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-fortnights_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/time.rb, line 53</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fortnights</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Duration</span>.<span class="ruby-identifier">weeks</span>(<span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-gigabyte"> <b>gigabyte</b>() <a href="../classes/Numeric.html#method-i-gigabyte" name="method-i-gigabyte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-gigabytes">gigabytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-gigabytes"> <b>gigabytes</b>() <a href="../classes/Numeric.html#method-i-gigabytes" name="method-i-gigabytes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of bytes equivalent to the gigabytes provided.</p> <pre><code>2.gigabytes # =&gt; 2_147_483_648 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-gigabyte">gigabyte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-gigabytes_source')" id="l_method-i-gigabytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L39" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-gigabytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 39</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gigabytes</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-constant">GIGABYTE</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-hour"> <b>hour</b>() <a href="../classes/Numeric.html#method-i-hour" name="method-i-hour" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-hours">hours</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-hours"> <b>hours</b>() <a href="../classes/Numeric.html#method-i-hours" name="method-i-hours" class="permalink">Link</a> </h3> <div class="description"> <p>Returns a Duration instance matching the number of hours provided.</p> <pre><code>2.hours # =&gt; 2 hours </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-hour">hour</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-hours_source')" id="l_method-i-hours_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/time.rb#L29" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-hours_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/time.rb, line 29</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">hours</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Duration</span>.<span class="ruby-identifier">hours</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-html_safe-3F"> <b>html_safe?</b>() <a href="../classes/Numeric.html#method-i-html_safe-3F" name="method-i-html_safe-3F" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-html_safe-3F_source')" id="l_method-i-html_safe-3F_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/string/output_safety.rb#L13" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-html_safe-3F_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/string/output_safety.rb, line 13</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">html_safe?</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-in_milliseconds"> <b>in_milliseconds</b>() <a href="../classes/Numeric.html#method-i-in_milliseconds" name="method-i-in_milliseconds" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of milliseconds equivalent to the seconds provided. Used with the standard time durations.</p> <pre><code>2.in_milliseconds # =&gt; 2000 1.hour.in_milliseconds # =&gt; 3600000 </code></pre> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-in_milliseconds_source')" id="l_method-i-in_milliseconds_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/time.rb#L63" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-in_milliseconds_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/time.rb, line 63</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">in_milliseconds</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-value">1000</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-kilobyte"> <b>kilobyte</b>() <a href="../classes/Numeric.html#method-i-kilobyte" name="method-i-kilobyte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-kilobytes">kilobytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-kilobytes"> <b>kilobytes</b>() <a href="../classes/Numeric.html#method-i-kilobytes" name="method-i-kilobytes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of bytes equivalent to the kilobytes provided.</p> <pre><code>2.kilobytes # =&gt; 2048 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-kilobyte">kilobyte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-kilobytes_source')" id="l_method-i-kilobytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L23" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-kilobytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 23</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">kilobytes</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-constant">KILOBYTE</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-megabyte"> <b>megabyte</b>() <a href="../classes/Numeric.html#method-i-megabyte" name="method-i-megabyte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-megabytes">megabytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-megabytes"> <b>megabytes</b>() <a href="../classes/Numeric.html#method-i-megabytes" name="method-i-megabytes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of bytes equivalent to the megabytes provided.</p> <pre><code>2.megabytes # =&gt; 2_097_152 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-megabyte">megabyte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-megabytes_source')" id="l_method-i-megabytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L31" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-megabytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 31</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">megabytes</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-constant">MEGABYTE</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-minute"> <b>minute</b>() <a href="../classes/Numeric.html#method-i-minute" name="method-i-minute" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-minutes">minutes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-minutes"> <b>minutes</b>() <a href="../classes/Numeric.html#method-i-minutes" name="method-i-minutes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns a Duration instance matching the number of minutes provided.</p> <pre><code>2.minutes # =&gt; 2 minutes </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-minute">minute</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-minutes_source')" id="l_method-i-minutes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/time.rb#L21" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-minutes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/time.rb, line 21</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">minutes</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Duration</span>.<span class="ruby-identifier">minutes</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-petabyte"> <b>petabyte</b>() <a href="../classes/Numeric.html#method-i-petabyte" name="method-i-petabyte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-petabytes">petabytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-petabytes"> <b>petabytes</b>() <a href="../classes/Numeric.html#method-i-petabytes" name="method-i-petabytes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of bytes equivalent to the petabytes provided.</p> <pre><code>2.petabytes # =&gt; 2_251_799_813_685_248 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-petabyte">petabyte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-petabytes_source')" id="l_method-i-petabytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L55" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-petabytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 55</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">petabytes</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-constant">PETABYTE</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-second"> <b>second</b>() <a href="../classes/Numeric.html#method-i-second" name="method-i-second" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-seconds">seconds</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-seconds"> <b>seconds</b>() <a href="../classes/Numeric.html#method-i-seconds" name="method-i-seconds" class="permalink">Link</a> </h3> <div class="description"> <p>Returns a Duration instance matching the number of seconds provided.</p> <pre><code>2.seconds # =&gt; 2 seconds </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-second">second</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-seconds_source')" id="l_method-i-seconds_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/time.rb#L13" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-seconds_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/time.rb, line 13</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">seconds</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Duration</span>.<span class="ruby-identifier">seconds</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-terabyte"> <b>terabyte</b>() <a href="../classes/Numeric.html#method-i-terabyte" name="method-i-terabyte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-terabytes">terabytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-terabytes"> <b>terabytes</b>() <a href="../classes/Numeric.html#method-i-terabytes" name="method-i-terabytes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of bytes equivalent to the terabytes provided.</p> <pre><code>2.terabytes # =&gt; 2_199_023_255_552 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-terabyte">terabyte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-terabytes_source')" id="l_method-i-terabytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L47" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-terabytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 47</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">terabytes</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-constant">TERABYTE</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-week"> <b>week</b>() <a href="../classes/Numeric.html#method-i-week" name="method-i-week" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-weeks">weeks</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-weeks"> <b>weeks</b>() <a href="../classes/Numeric.html#method-i-weeks" name="method-i-weeks" class="permalink">Link</a> </h3> <div class="description"> <p>Returns a Duration instance matching the number of weeks provided.</p> <pre><code>2.weeks # =&gt; 2 weeks </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-week">week</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-weeks_source')" id="l_method-i-weeks_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/time.rb#L45" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-weeks_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/time.rb, line 45</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">weeks</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Duration</span>.<span class="ruby-identifier">weeks</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-zettabyte"> <b>zettabyte</b>() <a href="../classes/Numeric.html#method-i-zettabyte" name="method-i-zettabyte" class="permalink">Link</a> </h3> <div class="description"> </div> <div class="aka"> Alias for: <a href="Numeric.html#method-i-zettabytes">zettabytes</a> </div> </div> <div class="method"> <h3 class="title method-title" id="method-i-zettabytes"> <b>zettabytes</b>() <a href="../classes/Numeric.html#method-i-zettabytes" name="method-i-zettabytes" class="permalink">Link</a> </h3> <div class="description"> <p>Returns the number of bytes equivalent to the zettabytes provided.</p> <pre><code>2.zettabytes # =&gt; 2_361_183_241_434_822_606_848 </code></pre> </div> <div class="aka"> Also aliased as: <a href="Numeric.html#method-i-zettabyte">zettabyte</a> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-zettabytes_source')" id="l_method-i-zettabytes_source">show</a> | <a href="https://github.com/rails/rails/blob/dd8f7185faeca6ee968a6e9367f6d8601a83b8db/activesupport/lib/active_support/core_ext/numeric/bytes.rb#L71" target="_blank" class="github_url">on GitHub</a> </p> <div id="method-i-zettabytes_source" class="dyn-source"> <pre><span class="ruby-comment"># File activesupport/lib/active_support/core_ext/numeric/bytes.rb, line 71</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">zettabytes</span> <span class="ruby-keyword">self</span> <span class="ruby-operator">*</span> <span class="ruby-constant">ZETTABYTE</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> </div> </main> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10