Permalink
Browse files

remove difficult irbrc config

  • Loading branch information...
1 parent 3aa2f56 commit 640a76ffbf4f5906cd08fb7aa8e0633ad4889e34 @alexch alexch committed Dec 1, 2011
Showing with 3 additions and 15 deletions.
  1. +3 −15 lessons/03.yaml
View
@@ -36,23 +36,11 @@ content: |
that having an interactive live session with ruby is invaluable. You
can learn a lot from it.
- Add this to a file called ~/.irbrc:
-
- <pre class="code">
- :::ruby
- class Object
- def pim inherited = false
- self.class.public_instance_methods(inherited).sort -
- Object.public_instance_methods
- end
- end
- </pre>
-
- Now you can do stuff like:
+ You can do stuff like:
$ irb
- >> "blah".pim
- => ["%", "*", "+", "<<", "<=>", "[]", "[]=", "bytes", "bytesize", ...]
+ >> "blah".methods
+ => [:<=>, :==, :===, :eql?, :hash, :casecmp, :+, :*, :%, :[], :[]=, :insert, :length, :size...]
All of these methods are available for any string. You can then use
`ri` to look up the method documentation. It is a great way to find goodies!

0 comments on commit 640a76f

Please sign in to comment.