Class: Module

Inherits:
Object show all
Defined in:
lib/coderunner/interactive_methods.rb

Instance Method Summary collapse

Instance Method Details

#help(meth_or_const = nil) ⇒ Object



427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/coderunner/interactive_methods.rb', line 427

def help(meth_or_const=nil)
  join = ""
  if meth_or_const
    if self.constants.include? meth_or_const.to_sym
      join = "::"
    elsif self.methods.include? meth_or_const.to_sym
      join = "."
    elsif self.instance_methods.include? meth_or_const.to_sym
      join = "#"
    end
  end
  CodeRunner.reference("#{self.to_s}#{join}#{meth_or_const}")
end