(PDOC-53) Handle directives with no types
Parameter directives with no types will have `tag.type` set to nil. We cannot append nil to an array, so instead, place it in the array and flatten the array. If the property is empty the second entry in the array will be nil, as we expect. If the `tag.type` is an array of types we will have and array with the form: [tag.text, type1, type2, type3, ...]
This commit is contained in:
parent
3a2f70026e
commit
7f4b81e77b
|
@ -3,7 +3,7 @@ require 'puppet_x/puppetlabs/strings/yard/core_ext/yard'
|
||||||
class PuppetX::PuppetLabs::Strings::YARD::Tags::PuppetTypeParameterDirective < YARD::Tags::Directive
|
class PuppetX::PuppetLabs::Strings::YARD::Tags::PuppetTypeParameterDirective < YARD::Tags::Directive
|
||||||
def call
|
def call
|
||||||
return if object.nil?
|
return if object.nil?
|
||||||
object.parameters << ([tag.text] + tag.types)
|
object.parameters << ([tag.text, tag.types].flatten)
|
||||||
object.parameter_details << {:name => tag.name, :desc => tag.text, :exists? => true, :puppet_type => true}
|
object.parameter_details << {:name => tag.name, :desc => tag.text, :exists? => true, :puppet_type => true}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue