O'Reilly logo

Beginning Ruby: From Novice to Professional by Peter Cooper

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Ruby's Building Blocks: Data, Expressions, and Flow Control

Computer programs spend nearly all their time manipulating data. We type in words, phrases, and numbers; listen to music; and watch videos, while the computer performs calculations, makes decisions, and relays information to us. To write computer programs, it's essential to understand the basics of data and its manipulation.

This chapter looks at some of the basic forms of data that Ruby supports, along with how to work with and manipulate them. The topics covered in this chapter will provide the majority of the foundation of knowledge on which your future Ruby programs will be developed.

Numbers and Expressions

At the lowest level, computers are entirely number-based, with everything ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required