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
Eric Weinstein
About the Author
About the Technical Reviewers
Foreword
Acknowledgments
Chapter 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
Note
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
Chapter 2. The King and His String
A Short Yarn
A Bit More About Variables
Ruby Operators
A Smallish Project for You
Note
You Know This!
Chapter 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!
Chapter 4. Staying in the Loop
Ruby on Monorails
while Loops
Note
Arrays
Putting Arrays and Loops into Action
Your Project, Should You Choose to Accept It
You Know This!
Chapter 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!
Chapter 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!
Chapter 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!
Chapter 8. Everything Is an Object (Almost)
The Subject of Our Story Is an Object
Classes and Objects
Creating Our First Class, Minstrel
Note
Note
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
Chapter 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!
Chapter 10. A Horse of a Different Color
Utter Panda-monium
Creating Modules
Constants
Extending Your Knowledge
Mixins and Inheritance
Requiring Another File
Note
Looking Up Constants
Note
A Horse of a Different Color
You Know This!
Chapter 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!
Chapter 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!
Chapter 13. Follow the WEBrick Road
Ruby and the Internet
Using the open-uri Ruby Gem
Note
Note
Investigating the Kingdom’s Web Server
Beyond the Kingdom Walls
You Know This!
Chapter 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
(http://railscasts.com/)
Ruby5 podcast
(http://ruby5.envylabs.com/)
Ruby Rogues
(http://rubyrogues.com/)
Ruby Tapas
(http://www.rubytapas.com/)
Ruby Weekly
(http://rubyweekly.com/)
Interactive Resources
Codecademy
(http://www.codecademy.com/tracks/ruby/)
Code School
(https://www.codeschool.com/paths/ruby/)
Ruby Koans
(http://rubykoans.com/)
Ruby Monk
(https://rubymonk.com/)
Additional Topics
The Enumerable module
Regular expressions
Procs and lambdas
Information hiding
Handling exceptions
Reflection/metaprogramming
Debugging
Threads and processes
Creating websites
Appendix A. Installing Ruby on Mac and Linux
Installing on Mac
Installing on Linux
Appendix 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
A note on the digital index
Symbols
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
Y
Z
Ruby Wizardry: An Introduction to Programming for Kids
Eric Weinstein
← Prev
Back
Next →
← Prev
Back
Next →