Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/ri_for/method_ri.rb,
lib/ri_for/method_ri.rb,
lib/ri_for/kernel_new_methods_list.rb
Overview
TODO add to sane [?]
Instance Method Summary collapse
- #my_methods(_super = false) ⇒ Object
-
#ri_for(name, options = {}) ⇒ Object
currently rather verbose, but will attempt to describe all it knows about a method.
- #singleton_class ⇒ Object
Instance Method Details
#my_methods(_super = false) ⇒ Object
18 19 20 21 |
# File 'lib/ri_for/kernel_new_methods_list.rb', line 18 def my_methods(_super=false) _methods = (_super) ? self.class.superclass.new.methods : Object.methods (self.methods - _methods).sort end |
#ri_for(name, options = {}) ⇒ Object
currently rather verbose, but will attempt to describe all it knows about a method
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/ri_for/method_ri.rb', line 171 def ri_for name, = {} if self.is_a?(Class) || self.is_a?(Module) # i.e. String.strip begin instance_method(name).ri() rescue NameError => e #allow for Class.instance_method_name, Module.instance_method_name begin method(name).ri() rescue NameError raise NameError.new("appears that this object #{self} does not have this method #{name}") end end else method(name).desc() end end |
#singleton_class ⇒ Object
12 13 14 |
# File 'lib/ri_for/method_ri.rb', line 12 def singleton_class class << self; self; end end |