Class: RDoc::Alias

Inherits:
CodeObject show all
Defined in:
lib/rdoc/code_objects.rb

Overview

Represent an alias, which is an old_name/ new_name pair associated with a particular context

Instance Attribute Summary collapse

Attributes inherited from CodeObject

#document_children, #document_self, #done_documenting, #force_documentation, #parent, #section, #viewer

Instance Method Summary collapse

Methods inherited from CodeObject

attr_overridable, #remove_classes_and_modules, #remove_methods_etc, #start_doc, #stop_doc

Constructor Details

#initialize(text, old_name, new_name, comment) ⇒ Alias

Returns a new instance of Alias.



693
694
695
696
697
698
699
# File 'lib/rdoc/code_objects.rb', line 693

def initialize(text, old_name, new_name, comment)
  super()
  @text = text
  @old_name = old_name
  @new_name = new_name
  self.comment = comment
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment



691
692
693
# File 'lib/rdoc/code_objects.rb', line 691

def comment
  @comment
end

#new_nameObject

Returns the value of attribute new_name



691
692
693
# File 'lib/rdoc/code_objects.rb', line 691

def new_name
  @new_name
end

#old_nameObject

Returns the value of attribute old_name



691
692
693
# File 'lib/rdoc/code_objects.rb', line 691

def old_name
  @old_name
end

#textObject

Returns the value of attribute text



691
692
693
# File 'lib/rdoc/code_objects.rb', line 691

def text
  @text
end

Instance Method Details

#to_sObject



701
702
703
# File 'lib/rdoc/code_objects.rb', line 701

def to_s
  "alias: #{self.old_name} ->  #{self.new_name}\n#{self.comment}"
end