Intoduction
  • Welcome
  • Course layout & Contact details
Ruby Insights
  • Everything is an Object
  • Open classes, DuckType, Runnable code
  • Material Revision
  • Lectures 2, 3 and 4
  • Classes are objects
  • Additional material & Revision: Classes are objects
  • Scopes
  • Additional material & Revision: Scopes
  • Covers: Classes are objects + Scopes
  • Classes are modules with hierarchy
  • Additional material & Revision: Classes are Modules
  • Inheritance hierarchy
  • Additional material & Revision: Inheritance Hierarchy
  • Classes are Modules & Inheritance Hierarchy
  • Where variables and methods live?
  • Revision: Where variables & methods live?
  • Method lookup
  • Revision: Method lookup
  • Variables & Variable Scope
  • Ruby Object Model
  • Blocks, Closures, Binding
Metaprogrammer's Toolkit
  • Querying about classes / methods / variables
  • Practice: Imitating Custom Language Keywords
  • Defining classes / methods / variables
  • Practice: Creating our own "attr_accessor" method
  • Changing existing classes / methods / variables
  • Practice: Implementing Rails’ “alias_method_chain"
  • Evaluate code in different contexts
  • Hook into changes in classes / methods / variables
  • Practice: Write your own "ActiveSupport::Concern"
  • Practice: Going through Rails' ActiveSupport::Concern code
Practice and Excersises
  • Task: Write your own .tap() method in Ruby 1.8
  • Solution: Write and improve the .tap() method
  • Task: Implement "Struct" class
  • Solution: Custom implementation of "Struct" class
  • Task: Write DSL for HTML code generation
  • Solution: Write DSL for HTML code generator
  • Example: Evaluating code in "isolated" scope
  • Example: Sharing scopes among specific Classes or methods
  • Exercise: Demystifying Rails magic