Class: RDocF95::ClassModule

Inherits:
Context show all
Defined in:
lib/rdoc-f95/code_objects.rb,
lib/rdoc-f95/parsers/parse_f95.rb

Overview

Extend ClassModule class for parse_f95.rb Original class is defined in code_objects.rb.

  • The case of names of classes or modules or methods are ignored

Direct Known Subclasses

AnonClass, NormalClass, NormalModule, SingleClass

Instance Attribute Summary collapse

Attributes inherited from Context

#aliases, #attributes, #constants, #in_files, #includes, #method_list, #name, #requires, #sections, #visibility

Attributes inherited from CodeObject

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

Instance Method Summary collapse

Methods inherited from Context

#<=>, #add_alias, #add_attribute, #add_class, #add_class_or_module, #add_constant, #add_include, #add_method, #add_module, #add_require, #add_to, #classes, #defined_in?, #each_attribute, #each_classmodule, #each_constant, #each_includes, #each_method, #find_attribute_named, #find_constant_named, #find_enclosing_module_named, #find_file, #find_instance_method_named, #find_local_symbol, #find_method_named, #find_module_named, #find_symbol, #include_includes?, #include_requires?, #initialize_classes_and_modules, #initialize_methods_etc, #modules, #ongoing_visibility=, #record_location, #remove_classes_and_modules, #remove_methods_etc, #set_current_section, #set_visibility_for, #toplevel

Methods inherited from CodeObject

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

Constructor Details

#initialize(name, superclass = nil) ⇒ ClassModule

Returns a new instance of ClassModule.



564
565
566
567
568
569
570
# File 'lib/rdoc-f95/code_objects.rb', line 564

def initialize(name, superclass = nil)
  @name       = name
  @diagram    = nil
  @superclass = superclass
  @comment    = ""
  super()
end

Instance Attribute Details

#diagramObject

Returns the value of attribute diagram.



562
563
564
# File 'lib/rdoc-f95/code_objects.rb', line 562

def diagram
  @diagram
end

#superclassObject (readonly)

Returns the value of attribute superclass.



561
562
563
# File 'lib/rdoc-f95/code_objects.rb', line 561

def superclass
  @superclass
end

Instance Method Details

#find_class_named(name) ⇒ Object



599
600
601
602
603
# File 'lib/rdoc-f95/code_objects.rb', line 599

def find_class_named(name)
  return self if full_name == name
  @classes.each_value {|c| return c if c.find_class_named(name) }
  nil
end

#find_file_named(name, method = nil, ignore_case = nil) ⇒ Object



536
537
538
# File 'lib/rdoc-f95/parsers/parse_f95.rb', line 536

def find_file_named(name, method=nil, ignore_case=nil)
  parent.find_file_named(name, method, ignore_case)
end

#full_nameObject

Return the fully qualified name of this class or module



573
574
575
576
577
578
579
# File 'lib/rdoc-f95/code_objects.rb', line 573

def full_name
  if @parent && @parent.full_name
    @parent.full_name + "::" + @name
  else
    @name
  end
end

#http_url(prefix) ⇒ Object



581
582
583
584
# File 'lib/rdoc-f95/code_objects.rb', line 581

def http_url(prefix)
  path = full_name.split("::")
  File.join(prefix, *path) + ".html"
end

#is_module?Boolean

Return true if this object represents a module

Returns:

  • (Boolean)


587
588
589
# File 'lib/rdoc-f95/code_objects.rb', line 587

def is_module?
  false
end

#to_sObject

to_s is simply for debugging



592
593
594
595
596
597
# File 'lib/rdoc-f95/code_objects.rb', line 592

def to_s
  res = self.class.name + ": " + @name 
  res << @comment.to_s
  res << super
  res
end