Module: Utils::IRB::Module
- Included in:
- Module
- Defined in:
- lib/utils/irb.rb
Instance Method Summary collapse
-
#ri(pattern = nil) ⇒ Object
Start
rifor module#pattern, trying to find a method matchingpatternfor all modules in the ancestors chain of this module.
Instance Method Details
#ri(pattern = nil) ⇒ Object
Start ri for module#pattern, trying to find a method matching pattern for all modules in the ancestors chain of this module.
396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/utils/irb.rb', line 396 def ri(pattern = nil) if pattern pattern = pattern.to_sym.to_s if pattern.respond_to? :to_sym ancestors.each do |a| if method = a.instance_methods(false).find { |m| pattern === m } a = Object if a == Kernel # ri seems to be confused system "ri #{a}##{method} | #{$pager}" end end else system "ri #{self} | #{$pager}" end return end |