# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
Note: Since Puppet 4.5.0 this can be done with String.new() and its many formatting options:
`$hex_repr = String(254, "%x")` return `"fe"`
`$hex_repr = String(254, "%#x")` return `"0xfe"`
@return [String] The converted value as a String
$binary_repr = String(5, '%b') # results in "101"
$hex_repr = String(254, "%x") # results in "fe"
$hex_repr = String(254, "%#x") # results in "0xfe"
DOC
DOC
raisePuppet::ParseError,'convert_base(): First argument must be either a string or an integer'unlessargs[0].is_a?(Integer)||args[0].is_a?(String)
raisePuppet::ParseError,'convert_base(): First argument must be either a string or an integer'unlessargs[0].is_a?(Integer)||args[0].is_a?(String)
raisePuppet::ParseError,'convert_base(): Second argument must be either a string or an integer'unlessargs[1].is_a?(Integer)||args[1].is_a?(String)
raisePuppet::ParseError,'convert_base(): Second argument must be either a string or an integer'unlessargs[1].is_a?(Integer)||args[1].is_a?(String)
ifargs[0].is_a?(String)
ifargs[0].is_a?(String)
raisePuppet::ParseError,'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10'unless%r{^[0-9]+$}.match?(args[0])
raisePuppet::ParseError,'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10'unlessargs[0]=~%r{^[0-9]+$}
end
end
ifargs[1].is_a?(String)
ifargs[1].is_a?(String)
raisePuppet::ParseError,'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10'unless%r{^[0-9]+$}.match?(args[1])
raisePuppet::ParseError,'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10'unlessargs[1]=~%r{^[0-9]+$}