Executes Your CodeʢRubyͲ͏ͬͯ͜ͷίʔυΛ࣮ߦͯ͠Δͷ͔ʣ 4: Control Structures and Method Dispatch ʢ੍ޚߏͱ͔ϝιουݺͼग़͠ͱ͔ʣ 5: Objects and ClassesʢΦϒδΣΫτͱΫϥεɺͳɻ͋Εͳɻʣ 6: Method Lookup and Constant Lookup ʢϝιου୳ࡧͱఆ୳ࡧʣ 7: The Hash Table: The Workhorse of Ruby Internals ʢϋογϡςʔϒϧɺRuby෦ͷͨΒ͖Ϟϊʣ 8: How Ruby Borrowed a Decades-Old Idea from Lisp ʢϒϩοΫRubyಠࣗͷಛͱ͔͡ΌͶ͔͑Βʂʣ 9: Metaprogramming ʢࠇຐज़ʣ 10: JRuby: Ruby on the JVM ʢJVMʣ, 11: Rubinius: Ruby Implemented with Ruby ʢRubiniusʣ 12: Garbage Collection in MRI, JRuby, and Rubinius ʢॲཧܥʹΑΔGC͍Ζ͍Ζʣ ࣍ͬ͟ͱݟ
flags klass RBasic VALUE RArray flags klass RBasic integer value Flags RObject δΣωϦοΫΦϒδΣΫτ FIXNUM_FLAG : 1 simple ruby value RObject numiv ivptr VALUE flags klass RBasic ଞɺRRegexp ͳͲΈࠐΈͷ ΦϒδΣΫτ ଞɺsymbolͳͲ ୯७ͳ
super RClass: Person super 1 4 2 ίϐʔʂ RClass: Professor super RClass: Employee super RClass: Professor super RClass: Employee super RClass: Employee super 3
࡞͞ΕɺΦϒδΣΫτͷΫϥεʹͳΔ RClass: Professor RClass: Professor super super ίϐʔʂ (module) (class) RClass: Mathematician super NPEVMF1SPGFTTPSFOE DMBTT.BUIFNBUJDJBO1FSTPO FOE N.BUIFNBUJDJBOOFX NFYUFOE1SPGFTTPS
BUUS@BDDFTTPSOBNF JODMVEF1SPGFTTPS FOE ! QPJODBSF.BUIFNBUJDBOOFX QPJODBSFOBNFl)FOSJ1PJODBSFz ! QQPJODBSFOBNF l)FOSJ1PJODBSFz ˌinclude ”Prof.”͕͔ͭͳ͍ RClass: Mathematician super RClass: Object super RClass: Professor super 1 2 3 attr_accessor: name def name “Prof. #{name}” end Mathematican͕ઌʹ୳͞ΕΔ …Professor ·Ͱ୳͞ͳ͍Ͱղܾ