Method: Puppet::Functions.min_max_param
- Defined in:
- lib/puppet/functions.rb
.min_max_param(method) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
280 281 282 283 284 285 286 287 |
# File 'lib/puppet/functions.rb', line 280 def self.min_max_param(method) result = { :req => 0, :opt => 0, :rest => 0 } # count per parameter kind, and get array of names names = method.parameters.map { |p| result[p[0]] += 1; p[1].to_s } from = result[:req] to = result[:rest] > 0 ? :default : from + result[:opt] [from, to, names] end |