Sha256: 1574a254dfb6964cdf0caf31e674330a894e6b7b19106678d8f582ba2c498f5f

Contents?: true

Size: 1.43 KB

Versions: 30

Compression:

Stored size: 1.43 KB

Contents

# frozen_string_literal: true
##
# A normal module, like NormalClass

class RDoc::NormalModule < RDoc::ClassModule

  def aref_prefix # :nodoc:
    'module'
  end

  def inspect # :nodoc:
    "#<%s:0x%x module %s includes: %p extends: %p attributes: %p methods: %p aliases: %p>" % [
      self.class, object_id,
      full_name, @includes, @extends, @attributes, @method_list, @aliases
    ]
  end

  ##
  # The definition of this module, <tt>module MyModuleName</tt>

  def definition
    "module #{full_name}"
  end

  ##
  # 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

      q.breakable
      q.text "constants:"
      q.breakable
      q.seplist @constants do |const| q.pp const end

      q.text "attributes:"
      q.breakable
      q.seplist @attributes do |attr| q.pp attr end
      q.breakable

      q.text "methods:"
      q.breakable
      q.seplist @method_list do |meth| q.pp meth end
      q.breakable

      q.text "aliases:"
      q.breakable
      q.seplist @aliases do |aliaz| q.pp aliaz end
      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

Version data entries

30 entries across 30 versions & 4 rubygems

Version Path
rdoc-6.4.1.1 lib/rdoc/normal_module.rb
rdoc-6.3.4.1 lib/rdoc/normal_module.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/rdoc-6.4.0/lib/rdoc/normal_module.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/rdoc-6.4.0/lib/rdoc/normal_module.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/rdoc-6.4.0/lib/rdoc/normal_module.rb
rdoc-6.4.0 lib/rdoc/normal_module.rb
rdoc-6.3.3 lib/rdoc/normal_module.rb
rdoc-6.1.2.1 lib/rdoc/normal_module.rb
rdoc-6.3.2 lib/rdoc/normal_module.rb
gitlab-rdoc-6.3.2 lib/rdoc/normal_module.rb
rdoc-6.3.1 lib/rdoc/normal_module.rb
rdoc-6.3.0 lib/rdoc/normal_module.rb
rdoc-6.2.1 lib/rdoc/normal_module.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/rdoc-6.1.1/lib/rdoc/normal_module.rb
rdoc-6.2.0 lib/rdoc/normal_module.rb
rdoc-6.1.2 lib/rdoc/normal_module.rb
rdoc-6.0.1.1 lib/rdoc/normal_module.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/rdoc-6.1.1/lib/rdoc/normal_module.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/rdoc-6.1.1/lib/rdoc/normal_module.rb
rdoc-6.1.1 lib/rdoc/normal_module.rb