Sha256: 703b835b718e7a87dfba129abc6b32a780fdc51ee03e2e939257bc59bbab6062

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

# Initializes the template.
# @return [void]
def init
  sections :header, :box_info, :summary, :overview, :note, :todo, 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! { |p| p.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! { |p| p.name }
  @tag_title = 'Parameters'
  erb(:parameters)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
puppet-strings-3.0.1 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-3.0.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-2.9.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-2.8.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-2.7.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-2.6.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
puppet-strings-2.5.0 lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb