Class: RDoc::Attr

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

Overview

Represent attributes

Instance Attribute Summary collapse

Attributes inherited from CodeObject

#comment, #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, name, rw, comment) ⇒ Attr

Returns a new instance of Attr.



722
723
724
725
726
727
728
729
# File 'lib/rdoc/code_objects.rb', line 722

def initialize(text, name, rw, comment)
  super()
  @text = text
  @name = name
  @rw = rw
  @visibility = :public
  self.comment = comment
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



720
721
722
# File 'lib/rdoc/code_objects.rb', line 720

def name
  @name
end

#rwObject

Returns the value of attribute rw.



720
721
722
# File 'lib/rdoc/code_objects.rb', line 720

def rw
  @rw
end

#textObject

Returns the value of attribute text.



720
721
722
# File 'lib/rdoc/code_objects.rb', line 720

def text
  @text
end

#visibilityObject

Returns the value of attribute visibility.



720
721
722
# File 'lib/rdoc/code_objects.rb', line 720

def visibility
  @visibility
end

Instance Method Details

#<=>(other) ⇒ Object



735
736
737
# File 'lib/rdoc/code_objects.rb', line 735

def <=>(other)
  self.name <=> other.name
end

#to_sObject



731
732
733
# File 'lib/rdoc/code_objects.rb', line 731

def to_s
  "attr: #{self.name} #{self.rw}\n#{self.comment}"
end