Books & Videos

Table of Contents

  1. Chapter 1 Strings, Numbers, Classes, and Objects

    1. Getting and Putting Input

    2. Strings and Embedded Evaluation

    3. Numbers

    4. Comments

    5. Testing a Condition: if..then

    6. Local and Global Variables

    7. Classes and Objects

  2. Chapter 2 Class Hierarchies, Attributes, and Class Variables

    1. Superclasses and Subclasses

    2. Passing Arguments to the Superclass

    3. Accessor Methods

    4. Attribute Readers and Writers

    5. Calling Methods of a Superclass

    6. Class Variables

  3. Chapter 3 Strings and Ranges

    1. User-Defined String Delimiters

    2. Backquotes

    3. String Handling

    4. Ranges

  4. Chapter 4 Arrays and Hashes

    1. Arrays

    2. Hashes

  5. Chapter 5 Loops and Iterators

    1. for Loops

    2. Blocks and Block Parameters

    3. Iterating upto and downto

    4. Multiple Iterator Arguments

    5. while Loops

    6. until Loops

    7. loop

  6. Chapter 6 Conditional Statements

    1. if..then..else

    2. and, or, and not

    3. Negation

    4. if..elsif

    5. unless

    6. if and unless Modifiers

    7. Case Statements

  7. Chapter 7 Methods

    1. Class Methods

    2. What Are Class Methods For?

    3. Class Variables

    4. Ruby Constructors: new or initialize?

    5. Singleton Methods

    6. Singleton Classes

    7. Overriding Methods

    8. Public, Protected, and Private Methods

  8. Chapter 8 Passing Arguments and Returning Values

    1. Summarizing Instance, Class, and Singleton Methods

    2. Returning Values

    3. Returning Multiple Values

    4. Default and Multiple Arguments

    5. Assignment and Parameter Passing

    6. Integers Are Special

    7. The One-Way-In, One-Way-Out Principle

    8. Modifying Receivers and Yielding New Objects

    9. Potential Side Effects of Reliance on Argument Values

    10. Parallel Assignment

  9. Chapter 9 Exception Handling

    1. rescue: Execute Code When Error Occurs

    2. ensure: Execute Code Whether or Not an Error Occurs

    3. else: Execute Code When No Error Occurs

    4. Error Numbers

    5. retry: Attempt to Execute Code Again After an Error

    6. raise: Reactivate a Handled Error

  10. Chapter 10 Blocks, Procs, and Lambdas

    1. What Is a Block?

    2. Line Breaks Are Significant

    3. Nameless Functions

    4. Look Familiar?

    5. Blocks and Arrays

    6. Procs and Lambdas

    7. Block or Hash?

    8. Creating Objects from Blocks

    9. What Is a Closure?

    10. yield

    11. Blocks Within Blocks

    12. Passing Named Proc Arguments

    13. Precedence Rules

    14. Blocks as Iterators

  11. Chapter 11 Symbols

    1. Symbols and Strings

    2. Symbols and Variables

    3. Why Use Symbols?

  12. Chapter 12 Modules and Mixins

    1. A Module Is Like a Class . . .

    2. Module Methods

    3. Modules as Namespaces

    4. Included Modules, or “Mixins”

    5. Name Conflicts

    6. Alias Methods

    7. Mix In with Care!

    8. Including Modules from Files

  13. Chapter 13 Files and IO

    1. Opening and Closing Files

    2. Characters and Compatibility

    3. Files and Directories

    4. Copying Files

    5. Directory Inquiries

    6. A Discursion into Recursion

    7. Sorting by Size

  14. Chapter 14 YAML

    1. Converting to YAML

    2. Nested Sequences

    3. Saving YAML Data

    4. Omitting Variables on Saving

    5. Multiple Documents, One File

    6. A YAML Database

    7. Adventures in YAML

  15. Chapter 15 Marshal

    1. Saving and Loading Data

    2. Omitting Variables on Saving

    3. Saving Singletons

  16. Chapter 16 Regular Expressions

    1. Making Matches

    2. Match Groups

    3. MatchData

    4. Prematch and Postmatch

    5. Greedy Matching

    6. String Methods

    7. File Operations

  17. Chapter 17 Threads

    1. Creating Threads

    2. Running Threads

    3. Going Native

    4. The Main Thread

    5. Thread Status

    6. Ensuring That a Thread Executes

    7. Thread Priorities

    8. The Main Thread Priority

    9. Mutexes

    10. Fibers

  18. Chapter 18 Debugging and Testing

    1. IRB: Interactive Ruby

    2. Debugging

    3. Unit Testing

  19. Chapter 19 Ruby on Rails

    1. Installing Rails

    2. Model-View-Controller

    3. A First Ruby on Rails Application

    4. Create a Rails Application

    5. Create a Controller

    6. Anatomy of a Simple Rails Application

    7. The Generate Controller Script Summarized

    8. Create a View

    9. Rails Tags

    10. Let’s Make a Blog!

  20. Chapter 20 Dynamic Programming

    1. Self-Modifying Programs

    2. eval

    3. Special Types of eval

    4. Adding Variables and Methods

    5. Creating Classes at Runtime

    6. Bindings

    7. send

    8. Removing Methods

    9. Handling Missing Methods

    10. Writing Programs at Runtime

    11. Exploring Further

  1. Appendix Documenting Ruby with RDoc

  2. Appendix Installing MySQL for Ruby on Rails

    1. Downloading MySQL

    2. Installing MySQL

    3. Configuring MySQL

    4. Can’t Find the Database?

  3. Appendix Further Reading

    1. Books

    2. Ebooks

    3. Websites

  4. Appendix Ruby and Rails Development Software

    1. IDEs and Editors

    2. Web Servers

    3. Databases

    4. Ruby Implementations

  5. Colophon

  6. Appendix Updates