AnyMethod is the base class for objects representing methods
# File rdoc/code_objects.rb, line 870 def <=>(other) @name <=> other.name end
# File rdoc/code_objects.rb, line 874 def add_alias(method) @aliases << method end
# File rdoc/code_objects.rb, line 878 def inspect alias_for = @is_alias_for ? " (alias for #{@is_alias_for.name})" : nil "#<%s:0x%x %s%s%s (%s)%s>" % [ self.class, object_id, parent_name, singleton ? '::' : '#', name, visibility, alias_for, ] end
# File rdoc/code_objects.rb, line 890 def param_seq params = params.gsub(/\s*\#.*/, '') params = params.tr("\n", " ").squeeze(" ") params = "(#{params})" unless p[0] == ?( if block = block_params then # yes, = # If this method has explicit block parameters, remove any explicit # &block params.sub!(/,?\s*&\w+/) block.gsub!(/\s*\#.*/, '') block = block.tr("\n", " ").squeeze(" ") if block[0] == ?( block.sub!(/^\(/, '').sub!(/\)/, '') end params << " { |#{block}| ... }" end params end