Chapter 8. Strings, symbols, and other scalar objects

This chapter covers
  • String object creation and manipulation
  • Methods for transforming strings
  • Symbol semantics
  • String/symbol comparison
  • Integers and floats
  • Time and date objects

The term scalar comes from mathematics, where it’s defined as an element that has magnitude but not a vector. For example, the temperature outside at any given time is a scalar element, whereas when temperature is measured every day for a month and plotted on a graph, the graph is a vector or non-scalar element.

In programming, scalar has a similar meaning. It refers to objects that represent single values, such as integers and strings, as opposed to collection or container objects that hold ...

Get The Well-Grounded Rubyist, 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.