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.

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.



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

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.



24
25
26
# File 'lib/puppet-strings/yard/code_objects/group.rb', line 24

def path
  @name.to_s
end

#typeSymbol

Gets the type of the group.

Returns:

  • (Symbol)

    Returns the type of the group.



30
31
32
# File 'lib/puppet-strings/yard/code_objects/group.rb', line 30

def type
  @name
end