Eloquent Ruby - book notes

Language Basics

Ch 01 - Syntax - Very Basics
- Comments
- Camels & Snakes
- Parentheses
- Line Folding
- Code Blocks
Ch 02 - Control Structures - If, Unless, While, Until
- Modifier forms
- Use each - not for
- Case
- Boolean logic pitfalls
Ch 03 - Smart Collections - Literal shortcuts
- Instant arrays & hashes from Method calls
- Iterating through a collection
- Bang (!) methods
- Hash ordering
Ch 04 - Smart Strings - Creating
- String methods
- Lines, characters & bytes
Ch 05 - Regexes - Matching one character at a time
- Sets, ranges & alternatives
- The Star ("*") operator
- Regexes in Ruby
- Beginnings & endings
Ch 06 - Symbols - Symbols vs Strings
- Not Quite a String
- Optimized to "stand for something"
Ch 07 - Everything is an Object - Classes, instances & methods - a quick review
- Objects: all the way down
- Key object attributes
- Public, private & protected methods
Ch 08 - Dynamic Typing - Shorter programs - not in the way you think
- Decoupling
- Ceremony vs Clarity
Ch 09 - Specs & Testing - Test::Unit basics
- Assert
- Rspec basics
- Tidy specs
- Stubs
- Mocks

Classes, Modules, Blocks

Ch 10 - Classes - Compressing specifications
- Composing Methods for Humans
- Composing Ruby Methods
- Single Exit Methods
Ch 11 - Operators - Defining Ruby Operators
- Examples
- Operating across Classes
- Broadening the Definition of "=="
- Well-Behaved Equality
- Triple Equals ("===") for Case Statements
- Hash Tables and eql?
- Well-Behaved Hash Keys
Ch 12 - Classes & Equality - An Identifier for your Documents
- Multiple Equality Methods
- Double Equals ("==")
Ch 13 - Singleton & Class Methods - Stubs
- The singleton class
- Singletons in Plain Sight
Ch 14 - Class Instance Variables - Quick Review
- "Wandering" Variables
- Class data
- Class Instances - Variables & Subclasses
- Convenience Tricks
Ch 15 - Modules & Name Spaces - A Place for your Stuff
- A Home for Utility Methods
- Building Modules
- Treat Modules as Objects (Because they are)
Ch 16 - Modules & Mixins - Better Books with Modules
- Mixin Modules to the Rescue
- Extending a Module
Ch 17 - Blocks & Iteration - Review of Code Blocks
- One Words after Another
- As Many Iterators as You Like
- Other Iterator Tools
- Enumerable: Your Iterator on Steroids
Ch 18 - Executing around Blocks - Logging
- When it Must Happen
- Initialization Blocks
- Scope and Blocks
- Carrying Answers Back
Ch 19 - Delayed Execution - Explicit Blocks
- The Callback Problem
- Banking Blocks
- Saving Blocks for Lazy Initialization
- Instant Block Objects

Metaprogramming

Ch 20 - Hooks - Waking up to a New Subclass
- Modules Want to be Heard
- Knowing When your Time is Up
- ...And a Cast of Thousands
Ch 21 - method_missing & Errors - Meeting those Missing Methods
- Handling Document Errors
- Coping with Constants
Ch 22 - method_missing & Delegation - Delegation
- Old-Fashioned Delegation Trouble
- method_missing
- More Discriminating Delegation
Ch 23 - method_missing & APIs - Building Form Letters One Word at a Time
- Magic Methods
- It's the Users that Count
Ch 24 - Monkey Patching (Existing Classes) - Wide-Open Classes
- Fixing a Broken Class
- Improving Existing Classes
- Renaming with alias_method
- Do Anything to any Class - Anytime
Ch 25 - Self-modifying Classes - Open Classes - Again
- Putting Logic in a Class
- Class Methods that Change their Class
Ch 26 - Classes that Modify Subclasses - A document of Paragraphs
- Subclassing
- Class Methods that Build Instance Methods
- Better Method Creation: define_method
- Modifications: the Sky is the Limit

Putting it Together

Ch 27 - Internal DSLs - Little Languages for Big Problems
- XML
- Stepping over the DSL Line
- Pulling out the Stops
Ch 28 - External DSLs - The Trouble with the Ripper
- Internal is not the only DSL
- Regex for Heavier Parsing
- Treetops
-
Ch 29 - Packaging Gems - Consuming Gems
- Gem Versions
- Nuts & Bolts
- Building a Gem
- Uploading Your Gem to a Repo
- Automating Gem Creation
Ch 30 - Ruby Implementations - Fistful of Rubies
- MRI
- YARV
- JRuby
- Rubinius