rw-book-cover

Metadata

Highlights

  • a really simple way to accomplishthis task would be to just store your instance variables in a hash table onthe instance so for example we’d haveour instance of hello here and we’d sayall right we got a hash table associatedwith the instance of hello the key tothe hash table is going to be the nameof the instance variable and the valuethe value in the hash table will be thethe value of the instance variable uhand we can imagine writing this writingthis code is pretty easy we couldimagine implementing it something likethis where we just have that hash tableassociated with all of our instanceswhen you write something it writes the hash table when you read something itreads from the hash table Etc like allthese seems pretty easy to implement ifwe understand how hash tables work infact this is this isassistance variables were implemented inRuby one eight and earlier that’s howthey how they worked uh Ruby 180 earlier (View Highlight)