diff options
| author | Seba Gamboa <[email protected]> | 2015-09-29 12:00:50 -0300 |
|---|---|---|
| committer | Seba Gamboa <[email protected]> | 2015-09-29 12:00:50 -0300 |
| commit | 5aaad840a7c59a4c5f2abaead892018c7059b11e (patch) | |
| tree | 8e6fe7557110e7bf701db363a87ac33cb78eea8e /lib/yard/mruby/code_objects/function_object.rb | |
| parent | d034793bd327d78aba0d99d719336d597e2413b0 (diff) | |
| download | yard-mruby-5aaad840a7c59a4c5f2abaead892018c7059b11e.tar.gz yard-mruby-5aaad840a7c59a4c5f2abaead892018c7059b11e.zip | |
Refactor return types
Diffstat (limited to 'lib/yard/mruby/code_objects/function_object.rb')
| -rw-r--r-- | lib/yard/mruby/code_objects/function_object.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/yard/mruby/code_objects/function_object.rb b/lib/yard/mruby/code_objects/function_object.rb index ecf7dd5..35b8e4f 100644 --- a/lib/yard/mruby/code_objects/function_object.rb +++ b/lib/yard/mruby/code_objects/function_object.rb @@ -22,6 +22,17 @@ module YARD::MRuby::CodeObjects '' end + def return_type + obj.tag(:return).types.first + end + + def return_type=(type) + return if type == 'void' + add_tag(YARD::Tags::Tag.new(:return,"", "")) unless has_tag?(:return) + tag(:return).types = [type] + end + + # Returns all alias names of the object # @return [Array<Symbol>] the alias names def aliases |
