Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
FCC - Technical Documentation Page
<div id="page-wrapper">
<nav id="navbar">
<a href="#Introduction" class="nav-link">Introduction</a>
<a href="#Features_of_Ruby" class="nav-link">Features of Ruby</a>
<a href="#How_to_get_Ruby" class="nav-link">How to get Ruby</a>
<a href="#How_to_compile_and_install_Ruby" class="nav-link">How to compile and install Ruby</a>
<a href="#Seeing_everything_as_an_Object" class="nav-link">Seeing everything as an Object</a>
<a href="#Ruby's_flexibility" class="nav-link">Ruby's flexibility</a>
<a href="#Blocks:_a_Truly_Expressive_Feature" class="nav-link">Blocks: a Truly Expressive Feature</a>
<a href="#Ruby_and_the_Mixin" class="nav-link">Ruby and the Mixin</a>
<a href="#Ruby's_Visual_Appearance" class="nav-link">Ruby's Visual Appearance</a>
<main id="main-doc">
<section class="main-section" id="Introduction">
<p>Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It has an elegant syntax that is natural to read and easy to write. It is simple, straightforward, and extensible.</p>
<p><a href="">The Ruby language home page</a></p>
<section class="main-section" id="Features_of_Ruby">
<header>Features of Ruby</header>
<li>Simple Syntax</li>
<li>Normal Object-oriented Features (e.g. class, method calls)</li>
<li>Advanced Object-oriented Features (e.g. mix-in, singleton-method)</li>
<li>Operator Overloading</li>
<li><a href=""> Exception</a> Handling</li>
<li>Iterators and Closures</li>
<li>Garbage Collection</li>
<li>Dynamic Loading of Object Files (on some architectures)</li>
<li>Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, macOS, Haiku, etc.) cf. <a href=""></a></li>
<section class="main-section" id="How_to_get_Ruby">
<header>How to get Ruby</header>
<section class="main-section" id="How_to_compile_and_install_Ruby">
<header>How to compile and install Ruby</header>
<section class="main-section" id="Seeing_everything_as_an_Object">
<header>Seeing Everything as an Object</header>
<p>In Ruby, everything is an object. Every bit of information and code can be given their own properties and actions. Object-oriented programming calls properties by the name instance variables and actions are known as methods. Ruby’s pure object-oriented approach is most commonly demonstrated by a bit of code which applies an action to a number.</p>
<code>5.times { print "We *love* Ruby -- it's outrageous!" }</code>
<p>In many languages, numbers and other primitive types are not objects. Ruby follows the influence of the Smalltalk language by giving methods and instance variables to all of its types. This eases one’s use of Ruby, since rules applying to objects apply to all of Ruby.</p>
<section class="main-section" id="Ruby's_flexibility">
<header>Ruby's flexibility</header>
<p>Ruby is seen as a flexible language, since it allows its users to freely alter its parts. Essential parts of Ruby can be removed or redefined, at will. Existing parts can be added upon. Ruby tries not to restrict the coder.</p>
<p>For example, addition is performed with the plus (+) operator. But, if you’d rather use the readable word plus, you could add such a method to Ruby’s builtin Numeric class.</p>
class Numeric
def plus(x)
y = 6
# y is now equal to 11
<p>Ruby’s operators are syntactic sugar for methods. You can redefine them as well.</p>
<section class="main-section" id="Blocks:_a_Truly_Expressive_Feature">
<header>Blocks: a Truly Expressive Feature</header>
<p>Ruby’s block are also seen as a source of great flexibility. A programmer can attach a closure to any method, describing how that method should act. The closure is called a block and has become one of the most popular features for newcomers to Ruby from other imperative languages like PHP or Visual Basic.</p>
<p>Blocks are inspired by functional languages. Matz said, “in Ruby closures, I wanted to respect the Lisp culture3.”</p>
search_engines =
%w[Google Yahoo MSN].map do |engine|
"http://www." + engine.downcase + ".com"
<p>In the above code, the block is described inside the do ... end construct. The map method applies the block to the provided list of words. Many other methods in Ruby leave a hole open for a coder to write their own block to fill in the details of what that method should do.</p>
<section class="main-section" id="Ruby_and_the_Mixin">
<header>Ruby and the Mixin</header>
<p>Unlike many object-oriented languages, Ruby features single inheritance only, on purpose. But Ruby knows the concept of modules (called Categories in Objective-C). Modules are collections of methods.</p>
<p>Classes can mixin a module and receive all its methods for free. For example, any class which implements the each method can mixin the Enumerable module, which adds a pile of methods that use each for looping.</p>
class MyArray
include Enumerable
<p>Generally, Rubyists see this as a much clearer way than multiple inheritance, which is complex and can be too restrictive.</p>
<section class="main-section" id="Ruby's_Visual_Appearance">
<header>Ruby's Visual Appearance</header>
<p>While Ruby often uses very limited punctuation and usually prefers English keywords, some punctuation is used to decorate Ruby. Ruby needs no variable declarations. It uses simple naming conventions to denote the scope of variables.</p>
var could be a local variable.
@var is an instance variable.
$var is a global variable.
<p>These sigils enhance readability by allowing the programmer to easily identify the roles of each variable. It also becomes unnecessary to use a tiresome <code>self</code>. prepended to every instance member.</p>
<script src=""></script>
Hello Camper!
For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding!
- The freeCodeCamp Team
// coded by @CharlesDeBarros
// eslint-disable-next-line no-unused-vars
const projectName = 'technical-docs-page';
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
- Select the project you would
like to complete from the dropdown
- Click the "RUN TESTS" button to
run the tests against the blank
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
/* Generic Styling */
@import url(';600&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
--black: rgba(0, 0, 0, 1);
--dim-grey: rgba(105, 105, 105, 1);
--faded-white: rgba(255, 255, 255, 1);
--light-grey: rgba(238, 238, 238, 0.8);
--ruby-red: rgba(155, 17, 30, 1);
--white: rgba(255, 255, 255, 1);
body {
font-family: 'Roboto Slab', serif;
font-size: 16px;
background-color: var(--light-grey);
header {
color: var(--ruby-red);
font-weight: 600;
a {
text-decoration: none;
color: var(--ruby-red);
ul {
list-style: none;
ul li::before {
content: "\2022";
color: var(--ruby-red);
font-weight: bold;
display: inline-block;
width: 1em;
margin-left: -1em;
/* Specific Styling */
/* */
/*;500 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment