APIdock / Ruby
/
method

from_module

ruby latest stable - Class: RDoc ::ClassModule
from_module(class_type, mod)
public

Return a RDoc::ClassModule of class class_type that is a copy of module module. Used to promote modules to classes.

# File lib/rdoc/class_module.rb, line 50
 def self.from_module class_type, mod
 klass = class_type.new mod.name
 mod.comment_location.each do |comment, location|
 klass.add_comment comment, location
 end
 klass.parent = mod.parent
 klass.section = mod.section
 klass.viewer = mod.viewer
 klass.attributes.concat mod.attributes
 klass.method_list.concat mod.method_list
 klass.aliases.concat mod.aliases
 klass.external_aliases.concat mod.external_aliases
 klass.constants.concat mod.constants
 klass.includes.concat mod.includes
 klass.extends.concat mod.extends
 klass.methods_hash.update mod.methods_hash
 klass.constants_hash.update mod.constants_hash
 klass.current_section = mod.current_section
 klass.in_files.concat mod.in_files
 klass.sections.concat mod.sections
 klass.unmatched_alias_lists = mod.unmatched_alias_lists
 klass.current_section = mod.current_section
 klass.visibility = mod.visibility
 klass.classes_hash.update mod.classes_hash
 klass.modules_hash.update mod.modules_hash
 klass.metadata.update mod.metadata
 klass.document_self = mod.received_nodoc ? nil : mod.document_self
 klass.document_children = mod.document_children
 klass.force_documentation = mod.force_documentation
 klass.done_documenting = mod.done_documenting
 # update the parent of all children
 (klass.attributes +
 klass.method_list +
 klass.aliases +
 klass.external_aliases +
 klass.constants +
 klass.includes +
 klass.extends +
 klass.classes +
 klass.modules).each do |obj|
 obj.parent = klass
 obj.full_name = nil
 end
 klass
 end

AltStyle によって変換されたページ (->オリジナル) /