-
Chapter 1 Ruby Basics
-
Hello, Matz
-
Interactive Ruby
-
Resources
-
Installing Ruby
-
Permission Denied
-
Associating File Types on Windows
-
Review Questions
-
-
Chapter 2 A Quick Tour of Ruby
-
Ruby Is Object-Oriented
-
Ruby's Reserved Words
-
Comments
-
Variables
-
Strings
-
Numbers and Operators
-
Conditional Statements
-
Arrays and Hashes
-
Methods
-
Blocks
-
Symbols
-
Exception Handling
-
Ruby Documentation
-
Review Questions
-
-
Chapter 3 Conditional Love
-
The if Statement
-
The case Statement
-
The while Loop
-
The loop Method
-
The for loop
-
Execution Before or After a Program
-
Review Questions
-
-
Chapter 4 Strings
-
Creating Strings
-
Concatenating Strings
-
Accessing Strings
-
Comparing Strings
-
Manipulating Strings
-
Case Conversion
-
Managing Whitespace, etc.
-
Incrementing Strings
-
Converting Strings
-
Regular Expressions
-
1.9 and Beyond
-
Review Questions
-
-
Chapter 5 Math
-
Class Hierarchy and Included Modules
-
Converting Numbers
-
Basic Math Operations
-
Ranges
-
Inquiring About Numbers
-
More Math Methods
-
Math Functions
-
Rational Numbers
-
Prime Numbers
-
Review Questions
-
-
Chapter 6 Arrays
-
Creating Arrays
-
Accessing Elements
-
Concatenation
-
Set Operations
-
Unique Elements
-
Blow Your Stack
-
Comparing Arrays
-
Changing Elements
-
Deleting Elements
-
Arrays and Blocks
-
Sorting Things and About Face
-
Multidimensional Arrays
-
1.9 and Beyond
-
Other Array Methods
-
Review Questions
-
-
Chapter 7 Hashes
-
Creating Hashes
-
Accessing Hashes
-
Iterating over Hashes
-
Changing Hashes
-
Converting Hashes to Other Classes
-
1.9 and Beyond
-
Other Hash Methods
-
Review Questions
-
-
Chapter 8 Working with Files
-
Directories
-
Creating a New File
-
Opening an Existing File
-
Deleting and Renaming Files
-
File Inquiries
-
Changing File Modes and Owner
-
The IO Class
-
Review Questions
-
-
Chapter 9 Classes
-
Defining the Class
-
Instance Variables
-
Accessors
-
Class Variables
-
Class Methods
-
Inheritance
-
Modules
-
public, private, or protected
-
Review Questions
-
-
Chapter 10 More Fun with Ruby
-
Formatting Output with sprintf
-
Processing XML
-
Date and Time
-
Reflection
-
Using Tk
-
Metaprogramming
-
RubyGems
-
Exception Handling
-
Creating Documentation with RDoc
-
Embedded Ruby
-
Review Questions
-
-
Chapter 11 A Short Guide to Ruby on Rails
-
Where Did Rails Come From
-
Why Rails?
-
What Have Other Folks Done with Rails?
-
Hosting Rails
-
Installing Rails
-
Learning Rails
-
A Brief Tutorial
-
Review Questions
-
-
Appendix Ruby Reference
-
Ruby Interpreter
-
Ruby's Reserved Words
-
Operators
-
Escape Characters
-
Predefined Variables
-
Global Constants
-
Regular Expressions
-
String Unpack Directives
-
Array Pack Directives
-
Sprintf Flags and Field Types
-
File Tests
-
Time Formatting Directives
-
RDoc Options
-
Rake
-
-
Appendix Answers to Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
Review Questions
-
-
Glossary
-
Colophon
- Title:
- Learning Ruby
- By:
- Michael Fitzgerald
- Publisher:
- O'Reilly Media
- Formats:
-
- 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
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.
