© Peter Cooper 2016

Peter Cooper, Beginning Ruby, 10.1007/978-1-4842-1278-3_3

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

Peter Cooper

(1)Louth, Lincs, UK

Computer programs spend nearly all their time manipulating data or waiting for data to arrive from elsewhere. 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 ...

Get Beginning Ruby: From Novice to Professional, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.