diff options
| author | Seba Gamboa <[email protected]> | 2015-09-29 14:32:23 -0300 |
|---|---|---|
| committer | Seba Gamboa <[email protected]> | 2015-09-29 14:32:23 -0300 |
| commit | 5bc3b5e82c771a8238f94c8c231cfacc22b5ecb3 (patch) | |
| tree | 2e78e6e6596fd601f825958d6c8870f4ba7efca4 /lib/yard/mruby/code_objects/function_object.rb | |
| parent | 207b24f6a43945b620adad9e26d236671b645465 (diff) | |
| download | yard-mruby-5bc3b5e82c771a8238f94c8c231cfacc22b5ecb3.tar.gz yard-mruby-5bc3b5e82c771a8238f94c8c231cfacc22b5ecb3.zip | |
Add function parameters to docs
Diffstat (limited to 'lib/yard/mruby/code_objects/function_object.rb')
| -rw-r--r-- | lib/yard/mruby/code_objects/function_object.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/yard/mruby/code_objects/function_object.rb b/lib/yard/mruby/code_objects/function_object.rb index 598257c..4609a21 100644 --- a/lib/yard/mruby/code_objects/function_object.rb +++ b/lib/yard/mruby/code_objects/function_object.rb @@ -31,6 +31,15 @@ module YARD::MRuby::CodeObjects @return_type = (type == 'void' ? nil : type) end + # Returns the list of parameters parsed out of the method signature + # with their default values. + # + # @return [Array<Array(String, String)>] a list of parameter names followed + # by their default values (or nil) + def parameters + parameter_types.map{|t| [t.name, nil] } + end + def parameter_types @parameter_types || [] end |
