Class: RDocF95::Attr

Inherits:
CodeObject show all
Defined in:
lib/rdoc-f95/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.



733
734
735
736
737
738
739
740
# File 'lib/rdoc-f95/code_objects.rb', line 733

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.



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

def name
  @name
end

#rwObject

Returns the value of attribute rw.



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

def rw
  @rw
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

#visibilityObject

Returns the value of attribute visibility.



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

def visibility
  @visibility
end

Instance Method Details

#<=>(other) ⇒ Object



746
747
748
# File 'lib/rdoc-f95/code_objects.rb', line 746

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

#to_sObject



742
743
744
# File 'lib/rdoc-f95/code_objects.rb', line 742

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