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 204 def self.convert_return(val3x) 205 if val3x == :undef 206 nil 207 elsif val3x.is_a?(Array) 208 val3x.map {|v| convert_return(v) } 209 elsif val3x.is_a?(Hash) 210 hsh = {} 211 val3x.each_pair {|k,v| hsh[convert_return(k)] = convert_return(v)} 212 hsh 213 else 214 val3x 215 end 216 end
Public Instance Methods
convert_Binary(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 187 def convert_Binary(o, scope, undef_value) 188 # Puppet 3x cannot handle Binary. Use the string form 189 o.to_s 190 end
convert_Regexp(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 171 def convert_Regexp(o, scope, undef_value) 172 # Puppet 3x cannot handle parameter values that are regular expressions. Turn into regexp string in 173 # source form 174 o.inspect 175 end
convert_Timespan(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 192 def convert_Timespan(o, scope, undef_value) 193 # Puppet 3x cannot handle Timespans. Use the string form 194 o.to_s 195 end
convert_Timestamp(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 197 def convert_Timestamp(o, scope, undef_value) 198 # Puppet 3x cannot handle Timestamps. Use the string form 199 o.to_s 200 end
convert_Version(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 177 def convert_Version(o, scope, undef_value) 178 # Puppet 3x cannot handle SemVers. Use the string form 179 o.to_s 180 end
convert_VersionRange(o, scope, undef_value)
click to toggle source
# File lib/puppet/pops/evaluator/runtime3_converter.rb 182 def convert_VersionRange(o, scope, undef_value) 183 # Puppet 3x cannot handle SemVerRanges. Use the string form 184 o.to_s 185 end