all repos — h3rald @ 014a4bffb19de55f0ef2494bc119480df3adb9b6

The sources of https://h3rald.com

contents/ruby-compendium/book/core-stdlib.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
-----
title: "Ruby Compendium – The Core and the Standard Library"
content-type: page
-----
<nav class="navigation"><a href="/ruby-compendium/book/syntax.html">← Syntax</a> | <a href="/ruby-compendium/book/index.html">Contents</a> | <a href="/ruby-compendium/book/features.html">Advanced Language Features →</a></nav>
<p>By default, Ruby always loads its core classes and modules when a script is executed. This means that in all Ruby programs you can always instantiate core objects like:</p>
<ul>
	<li>Numbers (integers, floats)</li>
	<li>Strings</li>
	<li>Arrays</li>
	<li>Hashes</li>
	<li>Files</li>
	<li>Regular expressions</li>
	<li>Symbols</li>
	<li>Threads</li>
	<li>Times and dates</li>
	<li>&#8230;and many more.</li>
</ul>
<p>Most likely, this is not going to be enough. That&#8217;s when the Standard Library comes into play: it&#8217;s a large collection of internal libraries that ships with every Ruby implementations. There are libraries to connect to the Internet, to read/write to various file formats such as <span class="caps">CSV</span> or <span class="caps">YAML</span>, to work with files and paths, access system features, and so on.</p>
<p>Unlike core classes, standard libraries must be required specifically if needed, before they can be used.</p>
<aside class="box">
<div class="box-title">If you want to know more...</div>
<p>On core libraries and the Standard Library, checkout the official documentation:</p>
<ul>
	<li><a href="http://www.ruby-doc.org/core/">Core Reference</a></li>
	<li><a href="http://www.ruby-doc.org/stdlib/">Standard Library Reference</a></li>
</ul>
<p>Overwhelmed? Don&#8217;t know where to start? Familiarize yourself with the <a href="http://www.ruby-doc.org/core/classes/Enumerable.html">Enumerable</a> module; you won&#8217;t regret it!</p>

</aside>
<nav class="navigation"><a href="/ruby-compendium/book/syntax.html">← Syntax</a> | <a href="/ruby-compendium/book/index.html">Contents</a> | <a href="/ruby-compendium/book/features.html">Advanced Language Features →</a></nav>