module Puppet::Interface::FullDocs

This module can be mixed in to provide a full set of documentation attributes. It is intended to be used for {Puppet::Interface}. @api public

Attributes

Public Instance Methods

author(value = nil) click to toggle source

@overload author(value)

Adds an author to the documentation for this object. To set
multiple authors, call this once for each author.
@param value [String] the name of the author
@api public
@dsl Faces

@overload author

Returns a list of authors
@return [String, nil] The names of all authors separated by
  newlines, or `nil` if no authors have been set.
@api private
    # File lib/puppet/interface/documentation.rb
202 def author(value = nil)
203   unless value.nil? then
204     unless value.is_a? String
205       #TRANSLATORS 'author' is an attribute name and should not be translated
206       raise ArgumentError, _('author must be a string; use multiple statements for multiple authors')
207     end
208 
209     if value =~ /\n/ then
210       #TRANSLATORS 'author' is an attribute name and should not be translated
211       raise ArgumentError, _('author should be a single line; use multiple statements for multiple authors')
212     end
213     @authors.push(Puppet::Interface::DocGen.strip_whitespace(value))
214   end
215   @authors.empty? ? nil : @authors.join("\n")
216 end
author=(value) click to toggle source

@api private

    # File lib/puppet/interface/documentation.rb
226 def author=(value)
227   # I think it's a bug that this ends up being the exposed
228   # version of `author` on ActionBuilder
229   if Array(value).any? {|x| x =~ /\n/ } then
230     #TRANSLATORS 'author' is an attribute name and should not be translated
231     raise ArgumentError, _('author should be a single line; use multiple statements')
232   end
233   @authors = Array(value).map{|x| Puppet::Interface::DocGen.strip_whitespace(x) }
234 end
Also aliased as: authors=
authors() click to toggle source

Returns a list of authors. See {author}. @return [String] The list of authors, separated by newlines. @api private

    # File lib/puppet/interface/documentation.rb
221 def authors
222   @authors
223 end
authors=(value)
Alias for: author=
short_description(value = nil) click to toggle source

@overload short_description(value)

Sets a short description for this object.
@param value [String, nil] A short description (about a paragraph)
  of this component. If `value` is `nil` the short_description
  will be set to the shorter of the first paragraph or the first
  five lines of {description}.
@return [void]
@api public
@dsl Faces

@overload short_description

Get the short description for this object
@return [String, nil] The short description of this object. If none is
  set it will be derived from {description}. Returns `nil` if
  {description} is `nil`.
@api private
    # File lib/puppet/interface/documentation.rb
178 def short_description(value = nil)
179   self.short_description = value unless value.nil?
180   if @short_description.nil? then
181     return nil if @description.nil?
182     lines = @description.split("\n")
183     first_paragraph_break = lines.index('') || 5
184     grab  = [5, first_paragraph_break].min
185     @short_description = lines[0, grab].join("\n")
186     @short_description += ' [...]' if (grab < lines.length and first_paragraph_break >= 5)
187   end
188   @short_description
189 end