On Wed, Nov 11, 2020 at 05:11:59PM +0800, Li Yuanchao wrote:
- def send_mail(message)
- email_message = if message.empty?
build_apply_account_email(@my_info)
else
build_apply_account_fail_email(@my_info, message)
end
This style is strange.
this style is suggested format for rubocop.
Thanks, Luan Shengde
You can define a method
def get_email_message(message) return build_apply_account_email(@my_info) if message.empty?
return build_apply_account_fail_email(@my_info, message) end
email_message = get_email_message(message)
Thanks, Yuanchao
- %x(curl -XPOST "#{@send_mail_host}:#{@send_mail_port}/send_mail_text" -d "#{email_message}")
- end
+end
2.23.0