Method: Danger::PluginParser#method_return_string

Defined in:
lib/danger/plugin_support/plugin_parser.rb

#method_return_string(meth) ⇒ Object

rubocop:disable Metrics/AbcSize



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/danger/plugin_support/plugin_parser.rb', line 91

def method_return_string(meth)
  return "" unless meth[:tags]

  return_value = meth[:tags].find { |t| t[:name] == "return" && t[:types] }
  return "" if return_value.nil?
  return "" if return_value[:types].nil?
  return "" unless return_value[:types].kind_of? Array

  unless return_value.empty?
    return "" if return_value[:types].first == "void"
    return return_value[:types].first
  end
  ""
end