2015-12-16 08:07:31 +03:00
|
|
|
# frozen_string_literal: false
|
2010-04-01 11:45:16 +04:00
|
|
|
##
|
|
|
|
# A normal module, like NormalClass
|
|
|
|
|
|
|
|
class RDoc::NormalModule < RDoc::ClassModule
|
|
|
|
|
2013-09-19 03:33:36 +04:00
|
|
|
def aref_prefix # :nodoc:
|
|
|
|
'module'
|
|
|
|
end
|
|
|
|
|
2010-04-01 11:45:16 +04:00
|
|
|
def inspect # :nodoc:
|
2012-11-27 08:28:14 +04:00
|
|
|
"#<%s:0x%x module %s includes: %p extends: %p attributes: %p methods: %p aliases: %p>" % [
|
2010-04-01 11:45:16 +04:00
|
|
|
self.class, object_id,
|
2012-11-27 08:28:14 +04:00
|
|
|
full_name, @includes, @extends, @attributes, @method_list, @aliases
|
2010-04-01 11:45:16 +04:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2011-02-02 03:32:30 +03:00
|
|
|
##
|
|
|
|
# The definition of this module, <tt>module MyModuleName</tt>
|
|
|
|
|
|
|
|
def definition
|
|
|
|
"module #{full_name}"
|
|
|
|
end
|
|
|
|
|
2010-04-01 11:45:16 +04:00
|
|
|
##
|
|
|
|
# This is a module, returns true
|
|
|
|
|
|
|
|
def module?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def pretty_print q # :nodoc:
|
|
|
|
q.group 2, "[module #{full_name}: ", "]" do
|
|
|
|
q.breakable
|
|
|
|
q.text "includes:"
|
|
|
|
q.breakable
|
|
|
|
q.seplist @includes do |inc| q.pp inc end
|
|
|
|
q.breakable
|
|
|
|
|
2012-11-27 08:28:14 +04:00
|
|
|
q.breakable
|
|
|
|
q.text "constants:"
|
|
|
|
q.breakable
|
|
|
|
q.seplist @constants do |const| q.pp const end
|
|
|
|
|
2010-04-01 11:45:16 +04:00
|
|
|
q.text "attributes:"
|
|
|
|
q.breakable
|
2012-11-27 08:28:14 +04:00
|
|
|
q.seplist @attributes do |attr| q.pp attr end
|
2010-04-01 11:45:16 +04:00
|
|
|
q.breakable
|
|
|
|
|
|
|
|
q.text "methods:"
|
|
|
|
q.breakable
|
2012-11-27 08:28:14 +04:00
|
|
|
q.seplist @method_list do |meth| q.pp meth end
|
2010-04-01 11:45:16 +04:00
|
|
|
q.breakable
|
|
|
|
|
|
|
|
q.text "aliases:"
|
|
|
|
q.breakable
|
2012-11-27 08:28:14 +04:00
|
|
|
q.seplist @aliases do |aliaz| q.pp aliaz end
|
2010-04-01 11:45:16 +04:00
|
|
|
q.breakable
|
|
|
|
|
|
|
|
q.text "comment:"
|
|
|
|
q.breakable
|
|
|
|
q.pp comment
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
##
|
|
|
|
# Modules don't have one, raises NoMethodError
|
|
|
|
|
|
|
|
def superclass
|
|
|
|
raise NoMethodError, "#{full_name} is a module"
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|