Book description
It’s easy to write “correct” Ruby code. But it’s far harder to gain the fluency needed to write great Ruby code. To do that, you need to go beyond syntax and absorb the “Ruby way” of thinking and problem solving. In Eloquent Ruby, Russ Olsen helps you understand Ruby like true Rubyists do—so you can leverage its immense, surprising power.
Olsen draws on years of experience internalizing the Ruby culture and teaching Ruby to other programmers. He guides you to the “Ah Ha!” moments when it suddenly becomes clear why Ruby works the way it does and how you can take advantage of its unique approach.
Eloquent Ruby starts small, answering tactical questions focused on a single statement, method, test, or bug. You’ll learn how to write code that actually looks like Ruby (not Java); why Ruby has so many control structures; how to use strings, expressions, and symbols; and what dynamic typing is really good for.
Next, Olsen turns to bigger questions related to building methods and classes. You’ll discover why Ruby classes contain so many tiny methods, when to use operator overloading, and when to avoid it. Olsen explains how to write Ruby code that writes its own code—and why you’ll want to. He concludes with powerful project-level features and techniques ranging from gems to Domain Specific Languages.
The newest book in the renowned Addison-Wesley Professional Ruby Series, Eloquent Ruby will help you “put on your Ruby-colored glasses” and get results that make you a true believer.
Table of contents
- Title Page
- Copyright Page
- Praise for Eloquent Ruby
- Contents
- Foreword
- Preface
- Acknowledgments
- About the Author
-
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
- Appendix. Going Further
- Index
-
Footnotes
- Preface
- Acknowledgments
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12
- Chapter 13
- Chapter 14
- Chapter 15
- Chapter 16
- Chapter 17
- Chapter 18
- Chapter 19
- Chapter 20
- Chapter 21
- Chapter 22
- Chapter 23
- Chapter 24
- Chapter 25
- Chapter 26
- Chapter 27
- Chapter 28
- Chapter 29
- Chapter 30
- Chapter 31
Product information
- Title: Eloquent Ruby
- Author(s):
- Release date: February 2011
- Publisher(s): Addison-Wesley Professional
- ISBN: None
You might also like
book
Ruby Cookbook, 2nd Edition
Why spend time on coding problems that others have already solved when you could be making …
book
Ruby Cookbook
Do you want to push Ruby to its limits? The Ruby Cookbook is the most comprehensive …
book
Effective Ruby: 48 Specific Ways to Write Better Ruby
If you’re an experienced Ruby programmer, will help you harness Ruby’s full power to write more …
video
Ruby on Rails Tutorial, 6th Edition
20 Hours of Video Instruction is the best-selling complete video training course on web development with …