Buying Options
The Ruby Programming Language
Print $39.99
Add to Cart
Print+Ebook $43.99
Add to Cart
Ebook $31.99
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £30.99
Add to Cart
What is this?
Description
Bestselling author David Flanagan teams up with Ruby creator Yukihiro "Matz" Matsumoto and writer/cartoonist/programmer why the lucky stiff to bring you the authoritative guide to Ruby. Covering versions 1.9 and 1.8, this book helps you learn Ruby's lexical structure, primary expressions, conditionals, syntax, classes, the data it manipulates, and more. For experienced programmers who want to look at this language in depth, this guide is invaluable.
Full Description
Table of Contents
  1. Chapter 1 Introduction

    1. A Tour of Ruby

    2. Try Ruby

    3. About This Book

    4. A Sudoku Solver in Ruby

  2. Chapter 2 The Structure and Execution of Ruby Programs

    1. Lexical Structure

    2. Syntactic Structure

    3. File Structure

    4. Program Encoding

    5. Program Execution

  3. Chapter 3 Datatypes and Objects

    1. Numbers

    2. Text

    3. Arrays

    4. Hashes

    5. Ranges

    6. Symbols

    7. True, False, and Nil

    8. Objects

  4. Chapter 4 Expressions and Operators

    1. Literals and Keyword Literals

    2. Variable References

    3. Constant References

    4. Method Invocations

    5. Assignments

    6. Operators

  5. Chapter 5 Statements and Control Structures

    1. Conditionals

    2. Loops

    3. Iterators and Enumerable Objects

    4. Blocks

    5. Altering Control Flow

    6. Exceptions and Exception Handling

    7. BEGIN and END

    8. Threads, Fibers, and Continuations

  6. Chapter 6 Methods, Procs, Lambdas, and Closures

    1. Defining Simple Methods

    2. Method Names

    3. Methods and Parentheses

    4. Method Arguments

    5. Procs and Lambdas

    6. Closures

    7. Method Objects

    8. Functional Programming

  7. Chapter 7 Classes and Modules

    1. Defining a Simple Class

    2. Method Visibility: Public, Protected, Private

    3. Subclassing and Inheritance

    4. Object Creation and Initialization

    5. Modules

    6. Loading and Requiring Modules

    7. Singleton Methods and the Eigenclass

    8. Method Lookup

    9. Constant Lookup

  8. Chapter 8 Reflection and Metaprogramming

    1. Types, Classes, and Modules

    2. Evaluating Strings and Blocks

    3. Variables and Constants

    4. Methods

    5. Hooks

    6. Tracing

    7. ObjectSpace and GC

    8. Custom Control Structures

    9. Missing Methods and Missing Constants

    10. Dynamically Creating Methods

    11. Alias Chaining

    12. Domain-Specific Languages

  9. Chapter 9 The Ruby Platform

    1. Strings

    2. Regular Expressions

    3. Numbers and Math

    4. Dates and Times

    5. Collections

    6. Files and Directories

    7. Input/Output

    8. Networking

    9. Threads and Concurrency

  10. Chapter 10 The Ruby Environment

    1. Invoking the Ruby Interpreter

    2. The Top-Level Environment

    3. Practical Extraction and Reporting Shortcuts

    4. Calling the OS

    5. Security

  1. Colophon

View Full Table of Contents
Product Details
Title:
The Ruby Programming Language
By:
David Flanagan, Yukihiro Matsumoto
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
January 2008
Ebook Release:
December 2008
Pages:
448
Print ISBN:
978-0-596-51617-8
| ISBN 10:
0-596-51617-7
Ebook ISBN:
978-0-596-15840-8
| ISBN 10:
0-596-15840-8
Customer Reviews
About the Authors
  1. David Flanagan

    David Flanagan is a computer programmer who spends most of his time writing about JavaScript and Java. His books with O'Reilly include JavaScript: The Definitive Guide, JavaScript Pocket Reference, Java in a Nutshell, Java Examples in a Nutshell, and Java Foundation Classes in a Nutshell. David has a degree in computer science and engineering from the Massachusetts Institute of Technology. He lives with his wife and children in the U.S. Pacific Northwest bewteen the cities of Seattle, Washington and Vancouver, British Columbia. David has a blog at www.davidflanagan.com.

    View David Flanagan's full profile page.

  2. Yukihiro Matsumoto

    Yukihiro Matsumoto ("Matz"), the creator of Ruby, is a professional programmer who worked for the Japanese open source company, netlab.jp. Matz is also known as one of the open source evangelists in Japan. He's released several open source products, including cmail, the emacs-based mail user agent, written entirely in emacs lisp. Ruby is his first piece of software that has become known outside of Japan.

    View Yukihiro Matsumoto's full profile page.

Colophon

The animals on the cover of The Ruby Programming Language are Horned Sungem hummingbirds (Heliactin bilophus). These small birds are native to South America, living mainly in Brazil and Bolivia. They prefer dry, open habitats such as grasslands, and they avoid dense or humid forests.

Hummingbirds have the fastest wingbeat of all birds, and the Horned Sungem is capable of 90 wingbeats per second. (Contrast that with the vulture, the slowest of all birds, capable of just 1 wingbeat per second.) Because hummingbirds are so fast and light, they are able to hover in mid-air by rapidly flapping their wings. They can also fly backward (the only birds who can do so) in order to keep position as they drink nectar from flowers. Their long, thin bills allow them to reach deep within blossoms. Fittingly, the Portuguese word for hummingbird is beija-flor, or "the bird that kisses flowers." The English word, of course, comes from the hum made by its fast-moving wings.

The male Horned Sungem has tufts of red, blue, and gold feathers on either side of its head. Its back is iridescent green, its throat and breast are black, and its belly is white. It has a long, pointed tail. The female looks similar to the male but lacks the dramatic crown pattern. Because of the hummingbird's vibrant colors, early Spanish explorers named it Joyas voladoras, or "flying jewel."

There are many myths about hummingbirds. In Brazil, a black hummingbird is a sign of a death in the family. The ancient Aztecs honored them, and priests used staffs covered with their feathers to remove curses. The hummingbird is also a symbol of resurrection, as Aztecs believed that dead warriors were reincarnated as these birds. The Aztec god of the Sun and war, Huitzilopochtli, was represented as one; his name means "Hummingbird from the south," the south being the location of the spirit world.

The cover image is from J. G. Wood's Animate Creation. The cover font is Adobe's ITC Garamond. The text font is Linotype Birka, the heading font is Adobe Myriad Condensed, and the code font is LucasFont's TheSans Mono Condensed.

  • Book cover of The Ruby Programming Language