Book description
There may be no better way to learn how to program than by dissecting real, representative examples written in your language of choice. Ruby by Example analyzes a series of Ruby scripts, examining how the code works, explaining the concepts it illustrates, and showing how to modify it to suit your needs. Baird's examples demonstrate key features of the language (such as inheritance, encapsulation, higher-order functions, and recursion), while simultaneously solving difficult problems (such as validating XML, creating a bilingual program, and creating command-line interfaces). Each chapter builds upon the previous, and each key concept is highlighted in the margin to make it easier for you to navigate the book.
You'll learn how to:
Use the interactive Ruby shell (irb) to learn key features of the language
Extend Ruby using RubyGems, the Ruby package manager
Create numerical utilities, as well as utilities that process and analyze HTML/XML
Implement purely functional and metaprogramming techniques to save time and effort
Optimize, profile, and test your code to make sure that it not only does its job, but does it well
Create web applications using Rails
Ruby is the fastest growing programming language today, and for good reason: Its elegant syntax and readable code make for prolific and happy programmers. But it can be difficult to understand and implement without a little help. Ruby by Example shows you how to take advantage of Ruby as you explore Ruby's fundamental concepts in action.
Table of contents
-
Ruby By Example: Concepts and Code
- Acknowledgments
- Introduction: What Is Ruby?
- 1. Interactive Ruby and the Ruby Environment
- 2. Amusements and Simple Utilities
- 3. Programmer Utilities
- 4. Text Manipulation
- 5. Number Utilities
-
6. Functionalism with Blocks and Procs
- #20 Our First lambda (make_incrementer.rb)
- #21 Using Procs for Filtering (matching_members.rb)
- #22 Using Procs for Compounded Filtering (matching_compound_members.rb)
- #23 Returning Procs as Values (return_proc.rb)
- #24 Nesting lambdas
- #25 Procs for Text (willow_and_anya.rb)
- Chapter Recap
-
7. Using, Optimizing, and Testing Functional Techniques
- #26 Basic Factorials and Fibonaccis (factorial1.rb through fibonacci5.rb)
- #27 Benchmarking and Profiling (tests/test_opts.rb)
- #28 Converting Temperatures (temperature_converter.rb)
- #29 Testing temperature_converter.rb (tests/test_temp_converter.rb)
- Chapter Recap
- 8. HTML and XML Tools
- 9. More Complex Utilities and Tricks, Part I
- 10. More Complex Utilities and Tricks, Part II
- 11. CGI and the Web
- 12. RubyGems and Rails Preparation
-
13. A Simple Rails Project
- Creating the Application
- Dissecting the Application
- Using the Application
- Learning More About Rails
- Chapter Recap
- A. How Does Ruby Compare to Other Languages?
- Index
- About the Author
- Colophon
Product information
- Title: Ruby by Example
- Author(s):
- Release date: June 2007
- Publisher(s): No Starch Press
- ISBN: 9781593271480
You might also like
book
Networking Fundamentals
Become well-versed with basic networking concepts such as routing, switching, and subnetting, and prepare for the …
video
Full Stack Web Development Mastery Course - Novice to Expert
Full stack development refers to the development of both frontend (client-side) and backend (server-side) portions of …
book
Practical Cloud Security
With their rapidly changing architecture and API-driven automation, cloud platforms come with unique security challenges and …
book
Powerful Command-Line Applications in Go
Whether you want to automate tasks, analyze data, parse logs, talk to network services, or address …