Read GitBook version here: Eloquent Ruby Notes · GitBook
Eloquent Ruby is a Ruby programming book teaches you how to write the Ruby style of Ruby code, and nurture your taste like Rubyists, and these files are my notes while tasting this wonderful book! Hope you enjoy!
suitable Ruby version: at least Ruby 1.9
- : done,
- : not yet
PART I: The Basics
- Chapter 1: Write Code That Looks Like Ruby
- Chapter 2: Choose the Right Control Structure
- Chapter 3: Take Advantage of Ruby’s Smart Collections
- Chapter 4: Take Advantage of Ruby’s Smart Strings
- Chapter 5: Find the Right String with Regular Expressions
- Chapter 6: Use Symbols to Stand for Something
- Chapter 7: Treat Everything Like an Object—Because Everything Is
- Chapter 8: Embrace Dynamic Typing
- Chapter 9: Write Specs!
PART II: Classes, Modules, and Blocks
- Chapter 10: Construct Your Classes from Short, Focused Methods
- Chapter 11: Define Operators Respectfully
- Chapter 12: Create Classes That Understand Equality
- Chapter 13: Get the Behavior You Need with Singleton and Class Methods
- Chapter 14: Use Class Instance Variables
- Chapter 15: Use Modules as Name Spaces
- Chapter 16: Use Modules as Mixins
- Chapter 17: Use Blocks to Iterate
- Chapter 18: Execute Around with a Block
- Chapter 19: Save Blocks to Execute Later
PART III: Metaprogramming
- Chapter 20: Use Hooks to Keep Your Program Informed
- Chapter 21: Use method_missing for Flexible Error Handling
- Chapter 22: Use method_missing for Delegation
- Chapter 23: Use method_missing to Build Flexible APIs
- Chapter 24: Update Existing Classes with Monkey Patching
- Chapter 25: Create Self-Modifying Classes
- Chapter 26: Create Classes That Modify Their Subclasses
PART IV: Pulling It All Together
- Chapter 27: Invent Internal DSLs
- Chapter 28: Build External DSLs for Flexible Syntax
- Chapter 29: Package Your Programs as Gems
- Chapter 30: Know Your Ruby Implementation
- Chapter 31: Keep an Open Mind to Go with Those Open Classes