Puppet Function: to_seconds

Defined in:
modules/wmflib/lib/puppet/parser/functions/to_seconds.rb
Function type:
Ruby 3.x API

Overview

to_seconds()Any

Returns:

  • (Any)


12
13
14
15
# File 'modules/wmflib/lib/puppet/parser/functions/to_seconds.rb', line 12

newfunction(:to_seconds, :type => :rvalue, :arity => 1) do |args|
  s = send(Puppet::Parser::Functions.function(:to_milliseconds), args) / 1000.0
  s.to_i == s ? s.to_i : s
end