0% found this document useful (0 votes)
29 views

Built-In Data Types

This document introduces some of the most common built-in data types in Ruby including numbers, strings, true/false/nil values, symbols, arrays, and hashes. These data types represent the basic "things" or objects that programmers work with in Ruby, covering around 98% of built-in types. Numbers and strings are among the most basic types, while symbols and arrays/hashes allow storing other objects. A brief overview of each type is provided to serve as fundamental building blocks before exploring how to define custom objects and classes.

Uploaded by

holy Crap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Built-In Data Types

This document introduces some of the most common built-in data types in Ruby including numbers, strings, true/false/nil values, symbols, arrays, and hashes. These data types represent the basic "things" or objects that programmers work with in Ruby, covering around 98% of built-in types. Numbers and strings are among the most basic types, while symbols and arrays/hashes allow storing other objects. A brief overview of each type is provided to serve as fundamental building blocks before exploring how to define custom objects and classes.

Uploaded by

holy Crap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

 Previous Next

 Ruby For Beginners


 Preface
 Programming is creation
 Learning to program
 Your tools
 Our Roadmap
 Object-oriented programming
 Variables
 Built-In Data Types
o Numbers
o Strings
o True, False, and Nil
o Symbols
o Arrays
o Hashes
 Objects, Classes, Methods
 Writing Methods
 Writing classes
 Blocks
 Conditionals
 Operators
 Bonus Chapters
 Advanced Topics
 Exercises (old)
 Exercises

Built-In Data Types


As mentioned before, Ruby comes with lots of things already baked in, and
provides you with tons of tools to use and hit the road running.
We’ll look at some of the most common data types in Ruby. Data types are
types of “things” that are mainly used to represent data, such as numbers,
text, and other values.
This is basically the “stuff” that you, as a Ruby programmers will work with,
when we work with actual data, that is interesting to you, or your users in one
way or the other.
We will discusss the following data types:
 Numbers
 Strings (texts)
 True, False, and Nil
 Symbols
 Arrays
 Hashes
These “kinds of things” (objects) cover like 98% of all built-in data types that
you’ll be using on a day to day basis, i.e. these are being used all over the
place. There are more data types, but those are rather exotic, and used much
less often.
Numbers and Strings (which is just a strange name for “texts”) are some of
the most basic “things” that you deal with in Ruby on a regular basis. The are
also just enough lego bricks for us to dive into more interesting topics, such as
how objects, classes, and methods relate to each other, and how you can
create your own ones.
Before we do so we will also briefly mention the “things” true, false, and nil,
just because these are things that we’ll come across along the way anyway.
Symbols also are very commonly used, but quite an odd concept. You
normally wouldn’t need to understand Symbols in order to write your own
code. We’ll still cover them briefly, and use them once in a while, just in case
you find them elsewhere.
Arrays and Hashes are “things” (objects) that are used to store other things,
and they’re super useful, and widely used.
 Ruby Monstas
 
 Ruby For Beginners
 
 Webapps For Beginners
 
 Testing For Beginners
 
 Email
 
 Twitter
 
 GitHub
 
 License
 
 Imprint

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy