Sha256: 7cd0717dabcf100f7b13e0e17df5937cf62329fbfe1d3216710367eac4f31142

Contents?: true

Size: 1.07 KB

Versions: 13

Compression:

Stored size: 1.07 KB

Contents

# extremely helpful documentation
# https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md#the-4x-api

# Example Documention for function using puppet strings
# https://github.com/puppetlabs/puppetlabs-strings
# When given two numbers, returns the one that is larger.
# You could have a several line description here if you wanted,
# but I don't have much to say about this function.
#
# @example using two integers
#   $bigger_int = max(int_one, int_two)
#
# @return [Integer] the larger of the two parameters
#
# @param num_a [Integer] the first number to be compared
# @param num_b [Integer] the second number to be compared
Puppet::Functions.create_function(:awesome_parser) do
  # the function below is called by puppet and and must match
  # the name of the puppet function above. You can set your
  # required parameters below and puppet 4 will enforce these
  # change x and y to suit your needs although only one parameter is required
  def awesome_parser(x,y)
    x >= y ? x : y
  end

  # you can define other helper methods in this code block as well
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
puppet-retrospec-1.8.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.7.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.6.1 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.6.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.5.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.4.1 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.4.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.3.2 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.3.1 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.3.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.2.1 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.2.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb
puppet-retrospec-1.1.0 spec/fixtures/fixture_modules/sample_module/lib/puppet/functions/awesome_parser.rb