Sha256: fc5abac5a14e2567d0d67d3d4dd2c1f719c3ee4abdb71e2f269a3273261cda50

Contents?: true

Size: 672 Bytes

Versions: 6

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

# Implements the base code object.
class PuppetStrings::Yard::CodeObjects::Base < YARD::CodeObjects::NamespaceObject
  # Allocates a new code object.
  # @param [Array] args The arguments to initialize the code object with.
  # @return Returns the code object.
  def self.new(*args)
    # Skip the super class' implementation because it detects :: in names and this will cause namespaces in the output we don't want
    object = Object.class.instance_method(:new).bind_call(self, *args)
    existing = YARD::Registry.at(object.path)
    object = existing if existing.instance_of?(self)
    yield(object) if block_given?
    object
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-strings-4.1.3 lib/puppet-strings/yard/code_objects/base.rb
puppet-strings-4.1.2 lib/puppet-strings/yard/code_objects/base.rb
puppet-strings-4.1.1 lib/puppet-strings/yard/code_objects/base.rb
puppet-strings-4.1.0 lib/puppet-strings/yard/code_objects/base.rb
puppet-strings-4.0.0 lib/puppet-strings/yard/code_objects/base.rb
puppet-strings-4.0.0.rc.1 lib/puppet-strings/yard/code_objects/base.rb