- 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.
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