Class: PuppetStrings::Yard::CodeObjects::Group

Inherits:
Base
  • Object
show all
Defined in:
lib/puppet-strings/yard/code_objects/group.rb

Overview

Implements the base class for “groups”.

A group behaves like a YARD namespace object, but displays differently in the HTML output.

Direct Known Subclasses

Classes, DefinedTypes, Functions, Plans, Providers, Tasks, Types

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

new

Class Method Details

.instance(key) ⇒ Object

Gets the singleton instance of the group.

Parameters:

  • key (Symbol)

    The key to lookup the group for.

Returns:

  • Returns the singleton instance of the group.



10
11
12
13
14
15
16
17
# File 'lib/puppet-strings/yard/code_objects/group.rb', line 10

def self.instance(key)
  instance = P(:root, key)
  return instance unless instance.is_a?(YARD::CodeObjects::Proxy)
  instance = self.new(:root, key)
  instance.visibility = :hidden
  P(:root).children << instance
  instance
end

Instance Method Details

#pathString

Gets the path to the group.

Returns:

  • (String)

    Returns the path to the group.



21
22
23
# File 'lib/puppet-strings/yard/code_objects/group.rb', line 21

def path
  @name.to_s
end

#typeSymbol

Gets the type of the group.

Returns:

  • (Symbol)

    Returns the type of the group.



27
28
29
# File 'lib/puppet-strings/yard/code_objects/group.rb', line 27

def type
  @name
end