Buying Options
Learning Ruby
Print $34.99
Add to Cart
Print+Ebook $38.49
Add to Cart
Ebook $27.99
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £26.99
Add to Cart
What is this?
Description
You don't have to know everything about a car to drive one, and you don't need to know everything about Ruby to start programming with it. Written for both experienced and new programmers alike, Learning Ruby is a just-get-in-and-drive book -- a hands-on tutorial that offers lots of Ruby programs and lets you know how and why they work, just enough to get you rolling down the road.
Full Description
Table of Contents
  1. Chapter 1 Ruby Basics

    1. Hello, Matz

    2. Interactive Ruby

    3. Resources

    4. Installing Ruby

    5. Permission Denied

    6. Associating File Types on Windows

    7. Review Questions

  2. Chapter 2 A Quick Tour of Ruby

    1. Ruby Is Object-Oriented

    2. Ruby's Reserved Words

    3. Comments

    4. Variables

    5. Strings

    6. Numbers and Operators

    7. Conditional Statements

    8. Arrays and Hashes

    9. Methods

    10. Blocks

    11. Symbols

    12. Exception Handling

    13. Ruby Documentation

    14. Review Questions

  3. Chapter 3 Conditional Love

    1. The if Statement

    2. The case Statement

    3. The while Loop

    4. The loop Method

    5. The for loop

    6. Execution Before or After a Program

    7. Review Questions

  4. Chapter 4 Strings

    1. Creating Strings

    2. Concatenating Strings

    3. Accessing Strings

    4. Comparing Strings

    5. Manipulating Strings

    6. Case Conversion

    7. Managing Whitespace, etc.

    8. Incrementing Strings

    9. Converting Strings

    10. Regular Expressions

    11. 1.9 and Beyond

    12. Review Questions

  5. Chapter 5 Math

    1. Class Hierarchy and Included Modules

    2. Converting Numbers

    3. Basic Math Operations

    4. Ranges

    5. Inquiring About Numbers

    6. More Math Methods

    7. Math Functions

    8. Rational Numbers

    9. Prime Numbers

    10. Review Questions

  6. Chapter 6 Arrays

    1. Creating Arrays

    2. Accessing Elements

    3. Concatenation

    4. Set Operations

    5. Unique Elements

    6. Blow Your Stack

    7. Comparing Arrays

    8. Changing Elements

    9. Deleting Elements

    10. Arrays and Blocks

    11. Sorting Things and About Face

    12. Multidimensional Arrays

    13. 1.9 and Beyond

    14. Other Array Methods

    15. Review Questions

  7. Chapter 7 Hashes

    1. Creating Hashes

    2. Accessing Hashes

    3. Iterating over Hashes

    4. Changing Hashes

    5. Converting Hashes to Other Classes

    6. 1.9 and Beyond

    7. Other Hash Methods

    8. Review Questions

  8. Chapter 8 Working with Files

    1. Directories

    2. Creating a New File

    3. Opening an Existing File

    4. Deleting and Renaming Files

    5. File Inquiries

    6. Changing File Modes and Owner

    7. The IO Class

    8. Review Questions

  9. Chapter 9 Classes

    1. Defining the Class

    2. Instance Variables

    3. Accessors

    4. Class Variables

    5. Class Methods

    6. Inheritance

    7. Modules

    8. public, private, or protected

    9. Review Questions

  10. Chapter 10 More Fun with Ruby

    1. Formatting Output with sprintf

    2. Processing XML

    3. Date and Time

    4. Reflection

    5. Using Tk

    6. Metaprogramming

    7. RubyGems

    8. Exception Handling

    9. Creating Documentation with RDoc

    10. Embedded Ruby

    11. Review Questions

  11. Chapter 11 A Short Guide to Ruby on Rails

    1. Where Did Rails Come From

    2. Why Rails?

    3. What Have Other Folks Done with Rails?

    4. Hosting Rails

    5. Installing Rails

    6. Learning Rails

    7. A Brief Tutorial

    8. Review Questions

  1. Appendix Ruby Reference

    1. Ruby Interpreter

    2. Ruby's Reserved Words

    3. Operators

    4. Escape Characters

    5. Predefined Variables

    6. Global Constants

    7. Regular Expressions

    8. String Unpack Directives

    9. Array Pack Directives

    10. Sprintf Flags and Field Types

    11. File Tests

    12. Time Formatting Directives

    13. RDoc Options

    14. Rake

  2. Appendix Answers to Review Questions

    1. Review Questions

    2. Review Questions

    3. Review Questions

    4. Review Questions

    5. Review Questions

    6. Review Questions

    7. Review Questions

    8. Review Questions

    9. Review Questions

    10. Review Questions

    11. Review Questions

  3. Glossary

  4. Colophon

View Full Table of Contents
Product Details
Title:
Learning Ruby
By:
Michael Fitzgerald
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
May 2007
Ebook Release:
December 2008
Pages:
256
Print ISBN:
978-0-596-52986-4
| ISBN 10:
0-596-52986-4
Ebook ISBN:
978-0-596-15964-1
| ISBN 10:
0-596-15964-1
Customer Reviews
Colophon

The animals on the cover of Learning Ruby are giraffes (Giraffa camelopardalis), the tallest of all land animals. A giraffe can reach 16 to 18 feet in height and weigh up to 3,000 pounds. Its species name, camelopardalis, is derived from an early Roman name, which described the giraffe as resembling both a camel and a leopard. The spots that cover its body act as camouflage in the African savanna. Its long neck and tough, prehensile tongue allow it to feed in treetops, consuming about 140 pounds of leaves and twigs daily. And its complex cardiovascular system and 24-pound heart regulate circulation throughout its tremendous body: in the upper neck, a pressure-regulation system prevents excess blood flow to the brain when the giraffe lowers its head to drink, while thick sheaths of skin on the lower legs maintain high extravascular pressure to compensate for the weight of the fluid pressing down on them.

Giraffes travel in herds comprised of about a dozen females, one or two males, and their young. Other males may travel alone, in pairs, or in bachelor herds. Male giraffes determine female fertility by tasting the female's urine to detect estrus. Yet sexual relations in male giraffes are most frequently homosexual: the proportion of same-sex courtships varies between 30 and 75 percent. Among females, homosexual mounting appears to comprise only 1 percent of all incidents. Gestation lasts between 14 and 15 months, after which a single calf is born. Only 25 to 50 percent of calves reach adulthood, as the giraffe's predators--including lions, leopards, hyenas, and African wild dogs--mainly prey on young.

Giraffes use their long necks and keen sense of smell, hearing, and eyesight to guard against attacks. They can reach speeds of up to 30 miles per hour and fight off predators using their muscular hind legs. A single kick from an adult giraffe can shatter a lion's skull. Giraffes were once hunted for their skin and tail but are currently a protected species.

  • Book cover of Learning Ruby