Sha256: 4af89c3b78488faef87d5921ca6222dcfcdfc19fb96b7b8b13f8f358d5701878

Contents?: true

Size: 615 Bytes

Versions: 3

Compression:

Stored size: 615 Bytes

Contents

# (see Ruby::PrivateConstantHandler)
class YARD::Handlers::Ruby::Legacy::PrivateConstantHandler < YARD::Handlers::Ruby::Legacy::Base
  handles /\Aprivate_constant(\s|\(|$)/
  namespace_only

  process do
    tokval_list(statement.tokens[2..-1], :attr, TkCONSTANT).each do |name|
      privatize_constant name
    end
  end

  private

  def privatize_constant(name)
    const = Proxy.new(namespace, name)
    ensure_loaded!(const)
    const.visibility = :private
  rescue NamespaceMissingError
    raise UndocumentableError, "private visibility set on unrecognized constant: #{name}"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
deg-yard-0.8.7.4 lib/yard/handlers/ruby/legacy/private_constant_handler.rb
deg-yard-0.8.7.3 lib/yard/handlers/ruby/legacy/private_constant_handler.rb
deg-yard-0.8.7.1 lib/yard/handlers/ruby/legacy/private_constant_handler.rb