Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Ruby Wizardry: An Introduction to Programming for Kids
Dedication
About the Author
About the Technical Reviewers
Foreword
Acknowledgments
1. What This Book’s About
Why Learn Programming (and Why Ruby)?
All Adults on Deck: Installing Ruby
Installing on Mac or Linux
Installing on Windows
Using RubyInstaller
Achievement Unlocked: Ruby Installed!
Putting on the Ruby Slippers
Getting to Know IRB
Using a Text Editor and the ruby Command
Mac
Linux
Windows
Creating Your First Script
When to Use IRB and When to Use a Text Editor
The Prompts Used in This Book
Into the Shiny Red Yonder
2. The King and His String
A Short Yarn
A Bit More About Variables
Ruby Operators
A Smallish Project for You
You Know This!
3. Pipe Dreams
The Apprentice Plumber’s Dilemma
Writing and Running Ruby Scripts
His Majesty’s Flow Control
Improving flow_rate.rb with Fancier Logical Operators
A Biggerish Project for You
You Know This!
4. Staying in the Loop
Ruby on Monorails
while Loops
Arrays
Putting Arrays and Loops into Action
Your Project, Should You Choose to Accept It
You Know This!
5. Array of Sunshine and Hash on the Range
Big Hank’s Hashery
Arrays Within Arrays
Even More Array Methods!
Shift! Pop! Insert!
Iterating with Arrays
Hash in the Hashery
Rollicking Ranges
Order Up!
You Know This!
6. The (Chunky) Bacon to Ruby’s Hash
Symbols!
The Skinny on Symbols
Symbols and Hashes, Together at Last
The Mid-morning Rush
What Else Can You Do with Symbols?
You Know This!
7. The Magic of Methods and Blocks
A Method to the Madness
Defining Your Own Methods
return Versus puts
Understanding Method Arguments
What Is nil?
Splat Parameters
Block Methods
Into the Dagron’s Lair
You Know This!
8. Everything Is an Object (Almost)
The Subject of Our Story Is an Object
Classes and Objects
Creating Our First Class, Minstrel
Variable Scope
These Variable Errors Will Shock and Surprise You!
Global Variables
Class Variables
Instance Variables
Local Variables
Objects and self
Methods and Instance Variables
Dial-a-Ballad, or the Minstrel’s Delivery Service
You Know This!
Objects and Classes
Variables and Scope
Object-Oriented Programming
9. Inheriting the Magic of Ruby
Her Majesty’s Menagerie
A Brush-up on Classes
A Couple of Classes
Inheritance and DRY Code
Subclass and Superclass
Overriding Methods: Pirates are People, Too
Using super
Protecting the Kingdom with GuardDogs and FlyingMonkeys
Every GuardDog Has His Day
Once More, with Feeling!
The Queen’s Machine
You Know This!
10. A Horse of a Different Color
Utter Panda-monium
Creating Modules
Constants
Extending Your Knowledge
Mixins and Inheritance
Requiring Another File
Looking Up Constants
A Horse of a Different Color
You Know This!
11. Second Time’s the Charm
Refactoring at the Refactory
Variable Assignment Tricks
Crystal-Clear Conditionals
When You Need a case Statement
Simplifying Methods
De-duplicating Code
Re-refactoring
You Know This!
12. Reading, Writing, and Ruby Magic
File Input and Output
Opening a File with Ruby
Writing and Adding to Files
Avoiding Errors While Working with Files
All Loading Docks, Report for Duty!
You Know This!
13. Follow the WEBrick Road
Ruby and the Internet
Using the open-uri Ruby Gem
Investigating the Kingdom’s Web Server
Beyond the Kingdom Walls
You Know This!
14. Where to Go Next
The Big Picture: What You Know
Additional Resources and Further Reading
Beginner Books
Intermediate Books
Advanced Books
Online and Multimedia
Railscasts
Ruby5 podcast
Ruby Rogues
Ruby Tapas
Ruby Weekly
Interactive Resources
Codecademy
Code School
Ruby Koans
Ruby Monk
Additional Topics
The Enumerable module
Regular expressions
Procs and lambdas
Information hiding
Handling exceptions
Reflection/metaprogramming
Debugging
Threads and processes
Creating websites
A. Installing Ruby on Mac and Linux
Installing on Mac
Installing on Linux
B. Troubleshooting
Errors Running Ruby Scripts
Command Not Found
No Such File or Directory
Errors Using IRB
Undefined Local Variable or Method
Syntax Error
Can’t Convert nil into String
You Were Saying . . . ?
Clear the Screen
Go Back to a Previous Command
Look It Up!
Updates
More Smart Books for Curious Kids!
Index
Copyright
← Prev
Back
Next →
← Prev
Back
Next →