Essential Tools
Irb
Check Ancestors
1.9.3-p545:023 > String.ancestors
= = [String, comparable, Object, Kernel, Basicobject]
String There are four superiors in front of the
Filtration Method
Ruby So many ways that you have to use grep up.
1.9.3-p545:049 > [].methods.grep/^me/
= = [: Member?,: Methods,: Method]
source of the search method
1.9.3-p545:018 > {}.method:select
= #<method:hash#select>
1.9.3-p545:019 > {}.method:reduce
= #<method:hash (Enumerable) #reduce >
Method method can be implemented.
Document
If you find a definite method, you can use RI , convenient and quick.
RI string.sub
Object Model
the principles of the various object languages are similar, but the internal implementation model is different. Ruby is simple to use and it's very complex inside.
When you feel Ruby Good time, in fact, should thank Matz 's work.
Kernel module is the core, There are a lot of important methods in it.
recommended to see the Ruby meta-Programming " , which is described in detail in the book.
Tips for Ruby debugging/practicing