The Ruby Programming Language
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
The Ruby Programming Language is the authoritative guide to Ruby and provides comprehensive coverage of versions 1.8 and 1.9 of the language. It was written (and illustrated!) by an all-star team:
- David Flanagan, bestselling author of programming language "bibles" (including JavaScript: The Definitive Guide and Java in a Nutshell) and committer to the Ruby Subversion repository.
- Yukihiro "Matz" Matsumoto, creator, designer and lead developer of Ruby and author of Ruby in a Nutshell, which has been expanded and revised to become this book.
- why the lucky stiff, artist and Ruby programmer extraordinaire.
The Ruby Programming Language
Publisher resources
Table of contents
- The Ruby Programming Language
- A Note Regarding Supplemental Files
- Preface
- 1. Introduction
- 2. The Structure and Execution of Ruby Programs
-
3. Datatypes and Objects
- Numbers
- Text
- Arrays
- Hashes
- Ranges
- Symbols
- True, False, and Nil
- Objects
-
4. Expressions and Operators
- Literals and Keyword Literals
- Variable References
- Constant References
- Method Invocations
- Assignments
-
Operators
- Unary + and –
- Exponentiation: **
- Arithmetic: +, –, *, /, and %
- Shift and Append: << and >>
- Complement, Union, Intersection: ~, &, |, and ^
- Comparison: <, <=, >, >=, and <=>
- Equality: ==, !=, =~, !~, and ===
- Boolean Operators: &&, ||, !, and, or, not
- Ranges and Flip-Flops: .. and ...
- Conditional: ?:
- Assignment Operators
- The defined? Operator
- Statement Modifiers
- Nonoperators
-
5. Statements and Control Structures
- Conditionals
- Loops
- Iterators and Enumerable Objects
- Blocks
- Altering Control Flow
- Exceptions and Exception Handling
- BEGIN and END
- Threads, Fibers, and Continuations
- 6. Methods, Procs, Lambdas, and Closures
-
7. Classes and Modules
-
Defining a Simple Class
- Creating the Class
- Instantiating a Point
- Initializing a Point
- Defining a to_s Method
- Accessors and Attributes
- Defining Operators
- Array and Hash Access with [ ]
- Enumerating Coordinates
- Point Equality
- Ordering Points
- A Mutable Point
- Quick and Easy Mutable Classes
- A Class Method
- Constants
- Class Variables
- Class Instance Variables
- Method Visibility: Public, Protected, Private
- Subclassing and Inheritance
- Object Creation and Initialization
- Modules
- Loading and Requiring Modules
- Singleton Methods and the Eigenclass
- Method Lookup
- Constant Lookup
-
Defining a Simple Class
- 8. Reflection and Metaprogramming
-
9. The Ruby Platform
- Strings
- Regular Expressions
- Numbers and Math
- Dates and Times
- Collections
- Files and Directories
- Input/Output
- Networking
- Threads and Concurrency
- 10. The Ruby Environment
- Index
- About the Authors
- Colophon
- Copyright
Product information
- Title: The Ruby Programming Language
- Author(s): David Flanagan, Yukihiro Matsumoto
- Release date: January 2008
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596516178
You might also like
book
Programming Ruby 3.3
by Noel Rappin, Dave Thomas
Ruby is one of the most important programming languages in use for web development. It powers …
video
Learn to Code with Ruby
by Boris Paskhaver
“Learn to Code with Ruby" is a meticulously crafted educational experience, designed to take you from …
book
Polished Ruby Programming
by Jeremy Evans
Elevate your Ruby skills to an advanced level by deepening your understanding of the design principles, …
book
Metaprogramming Ruby 2
by Paolo Perrotta
Write powerful Ruby code that is easy to maintain and change. With metaprogramming, you can produce …