Course Content
Basic Ruby concepts and features
- "Everything's an object"
- Local variables and assignment
- Top-level method definitions
- Arithmetic and logical operators
- Global variables
- The default object (self)
Object orientation in Ruby
- Messages and methods
- Ruby's class model
- Inheritance
- The object method lookup-path
Classes and modules
- Class methods
- Constants
- Module "mix-ins" in classes
- Modules as namespaces
- Instance method definition syntax
- Reopening class and module definitions
- Overriding methods
Instances and attributes
- Instance variables
- Attribute setter and getter techniques
- Ruby and the "Equal Access Principle"
Strings, symbols, and regular expressions
- Basic string manipulation and indexing
- Symbols and the symbol table
- Regular expression syntax
- Pattern-matching with scan, sub, and match
Collection objects and iterators
- Array, Hash, and Range classes
- Code blocks and iteration
- Creating iterators with the Enumerable module
- Collection filtering, selecting, and transforming
- Enumerators and external iteration
Object dynamism
- Adding singleton methods to objects
- Modular extension of per-object behavior
- Singleton classes
- Extending existing classes
Threads
- Starting, running, stopping threads
- Threads and variable scope
- Thread-safety considerations
Lambda and function objects
- Creating first-class functions
- Lambda argument semantics
- Variable scope and closures
- Block, Proc, lambda interaction
Metaprogramming
- The eval family of methods
- Programmatic method creation
- Runtime reflection on objects
- Traversing ObjectSpace
- method_missing and other hooks and callbacks
Exception handling
- The Exception class hierarchy
- Raising exceptions
- Rescue and ensure clauses
- Writing your own exception classes
File and I/O operations
- Keyboard input and screen output
- Basic file reading and writing
- File handles as iterators
- Low-level I/O techniques
Date, time, and numeric types
- Date, Time, and DateTime classes
- Date calculation and parsing
- Integers and floating-point numbers
The standard library
- StringIO hybrid objects
- Struct and OpenStruct
- Math extensions
- FileUtils and Pathname
- Socket and network programming facilities
- Administrative and system libraries
Testing in Ruby
- Unit testing principles
- The MiniTest and TestUnit libraries
Ruby tools
- Interactive Ruby (irb)
- Embedded Ruby (erb)
- The RubyGems packaging system
- Rake task management utility