summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown21
1 files changed, 18 insertions, 3 deletions
diff --git a/README.markdown b/README.markdown
index 44382c2..820be23 100644
--- a/README.markdown
+++ b/README.markdown
@@ -11,17 +11,19 @@ in Ruby 1.9
`method_source` is a utility to return a method's sourcecode as a
Ruby string. Also returns `Proc` and `Lambda` sourcecode.
+Method comments can also be extracted using the `comment` method.
+
It is written in pure Ruby (no C).
-`method_source` provides the `source` method to the `Method` and
+`method_source` provides the `source` and `comment` methods to the `Method` and
`UnboundMethod` and `Proc` classes.
* Install the [gem](https://rubygems.org/gems/method_source): `gem install method_source`
* Read the [documentation](http://rdoc.info/github/banister/method_source/master/file/README.markdown)
* See the [source code](http://github.com/banister/method_source)
-Example: methods
-----------------
+Example: display method source
+------------------------------
Set.instance_method(:merge).source.display
# =>
@@ -35,6 +37,14 @@ Example: methods
self
end
+Example: display method comments
+--------------------------------
+
+ Set.instance_method(:merge).comment.display
+ # =>
+ # Merges the elements of the given enumerable object to the set and
+ # returns self.=> nil
+
Limitations:
------------
@@ -49,3 +59,8 @@ Possible Applications:
for extra fun.
+Special Thanks
+--------------
+
+[Adam Sanderson](https://github.com/adamsanderson) for `comment` functionality.
+