Puppet Function: stdlib::end_with
- Defined in:
-
vendor_modules/stdlib/lib/puppet/functions/stdlib/end_with.rb
- Function type:
- Ruby 4.x API
Summary
Returns true if str ends with one of the prefixes given. Each of the prefixes should be a String.
Overview
stdlib::end_with(String $test_string, Variant[String[1],Array[String[1], 1]] $suffixes) ⇒ Boolean
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'vendor_modules/stdlib/lib/puppet/functions/stdlib/end_with.rb', line 6
Puppet::Functions.create_function(:'stdlib::end_with') do
dispatch :end_with do
param 'String', :test_string
param 'Variant[String[1],Array[String[1], 1]]', :suffixes
return_type 'Boolean'
end
def end_with(test_string, suffixes)
test_string.end_with?(*suffixes)
end
end
|