Sha256: f69ba2ccfb3253df2ae8b64b2f90b7a0ea9ffb55ed8359c651300fd248e664cf

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

# Initializes the template.
# @return [void]
def init
  sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :properties, :parameters, :features
end

# Renders the box_info section.
# @return [String] Returns the rendered section.
def box_info
  @providers = PuppetStrings::Yard::CodeObjects::Providers.instance(object.name).children
  erb(:box_info)
end

# Renders the properties section.
# @return [String] Returns the rendered section.
def properties
  # Properties are the same thing as parameters (from the documentation standpoint),
  # so reuse the same template but with a different title and data source.
  #
  # "checks" such as "creates" and "onlyif" are another type of property
  @parameters = (object.properties || []) + (object.checks || [])
  @parameters.sort_by!(&:name)
  @tag_title = 'Properties'
  erb(:parameters)
end

# Renders the parameters section.
# @return [String] Returns the rendered section.
def parameters
  @parameters = object.parameters || []
  @parameters.sort_by!(&:name)
  @tag_title = 'Parameters'
  erb(:parameters)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-strings-4.1.3 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-4.1.2 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-4.1.1 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-4.1.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-4.0.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-4.0.0.rc.1 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb