Chapter Recap
What was new in this chapter?
Dates
Constants versus magic numbers
Expressions with the
||operatorENV[‘HOME’]External file access, both reading and writing, using
File.newSplitting Strings into Arrays
Printing with
putsGenerating (pseudo-)random numbers
Running Ruby programs at the command line
Defining and instantiating new Classes
Instance variables:
@i_am_an_instance_variableRuby method naming conventions: predicate?, destructive!
Introduction to RDoc
Expression interpolation within Strings:
“#{interpolate_me}”Ternary operator: (
expression ? if_true : if_false)Access control
Open classes
Using
ARGVUsing the
eachmethod with blocksThe
systemmethod
That’s a great deal of non-trivial information. If you’re relatively new to programming, have ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access