Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Created August 30, 2017 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshCheek/b5145ee2855e08a5ea5f3228e85270f3 to your computer and use it in GitHub Desktop.
Save JoshCheek/b5145ee2855e08a5ea5f3228e85270f3 to your computer and use it in GitHub Desktop.
Object model intro

The Ruby Object Model (intro) aka "How Ruby Works"

What

The underlying structures that Ruby uses to interpret your code

Why

More effective (explains more, simpler) than whatever you're otherwise doing

Plan

  • Memorize
    • Symbol table (a hash table, its keys are always symbols)
    • Almost all of Ruby is implemented in 3 core structures
      • Object (data / noun)
        • store instance variables (symbol table)
        • store class pointer
      • Class (procedure / verb)
        • store instance methods (symbol table)
        • store superclass pointer
      • Binding (aka scope... stored on the stack)
        • store local variables (symbol table)
        • store self pointer
  • Quick chat... maybe
  • Challenges https://gist.github.com/JoshCheek/ad9f70a6d855be9ed50d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment