class Puppet::Pops::Evaluator::Runtime3FunctionArgumentConverter
A Ruby function written for the 3.x API cannot be expected to handle extended data types. This converter ensures that they are converted to String format @api private
Public Class Methods
convert_return(val3x)
click to toggle source
Converts result back to 4.x by replacing :undef with nil in Array and Hash objects
# File lib/puppet/pops/evaluator/runtime3_converter.rb 205 def self.convert_return(val3x) 206 if val3x == :undef 207 nil 208 elsif val3x.is_a?(Array) 209 val3x.map {|v| convert_return(v) } 210 elsif val3x.is_a?(Hash) 211 hsh = {} 212 val3x.each_pair {|k,v| hsh[convert_return(k)] = convert_return(v)} 213 hsh 214 else 215 val3x 216 end 217 end
Public Instance Methods
convert_Binary(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 188 def convert_Binary(o, scope, undef_value) 189 # Puppet 3x cannot handle Binary. Use the string form 190 o.to_s 191 end
convert_Regexp(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 172 def convert_Regexp(o, scope, undef_value) 173 # Puppet 3x cannot handle parameter values that are regular expressions. Turn into regexp string in 174 # source form 175 o.inspect 176 end
convert_Timespan(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 193 def convert_Timespan(o, scope, undef_value) 194 # Puppet 3x cannot handle Timespans. Use the string form 195 o.to_s 196 end
convert_Timestamp(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 198 def convert_Timestamp(o, scope, undef_value) 199 # Puppet 3x cannot handle Timestamps. Use the string form 200 o.to_s 201 end
convert_Version(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 178 def convert_Version(o, scope, undef_value) 179 # Puppet 3x cannot handle SemVers. Use the string form 180 o.to_s 181 end
convert_VersionRange(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 183 def convert_VersionRange(o, scope, undef_value) 184 # Puppet 3x cannot handle SemVerRanges. Use the string form 185 o.to_s 186 end