© Jay Godse 2018
Jay GodseRuby Data Processinghttps://doi.org/10.1007/978-1-4842-3474-7_1

1. Basic Ruby

Jay Godse1 
(1)
Kanata, Ontario, Canada
 

This section will acquaint or refresh you with basic ways to use the Ruby command line, as well as some relevant Ruby coding.

If you are comfortable programming in Ruby and understand the Ruby Enumerable Library reasonably well, you can skip this section.

The Command Line

After you install Ruby, you can fire up the interactive command line in Windows, Linux, or Mac OSX. I’m using Windows.

C:\>  irb
irb(main):001:0>

For brevity, I won’t write the full irb prompt every time.

You can execute Ruby statements line by line. The value returned by each expression is preceded by .

irb> a = 4
=> 4
irb> a
=> 4
irb> a + 7
=> ...

Get Ruby Data Processing: Using Map, Reduce, and Select 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.