My thoughts on software development
"any arbitrary string".methods.grep("ch")
personally I prefer:"str".ch TAB TAB
This works only if:1. You have a plugin for IRB that does autocompletion =)2. You know method prefix.With grep you can find names that contain some word (not start with some word):"abc".methods.grep(/index/)# => ["index", "rindex", "each_with_index"]"abc".methods.grep(/strip/)=> ["lstrip!", "strip", "rstrip!", "lstrip", "rstrip", "strip!"]
Отправить комментарий
2 комментария:
personally I prefer:
"str".ch TAB TAB
This works only if:
1. You have a plugin for IRB that does autocompletion =)
2. You know method prefix.
With grep you can find names that contain some word (not start with some word):
"abc".methods.grep(/index/)
# => ["index", "rindex", "each_with_index"]
"abc".methods.grep(/strip/)
=> ["lstrip!", "strip", "rstrip!", "lstrip", "rstrip", "strip!"]
Отправить комментарий