def create_report
report = @recipe.run_with_logger(@parameter_values)
if report @report = report
J2R.logger.info("report created")
bottom_message "Nombre de lignes #{@report.size}"
else
J2R.logger.error("error creating report")
bottom_message "Erreur à la création du rapport"
end
end
Looks perfectly OK to me. Creating two additional methods seems like
a lot of overkill which hinders readability. My 0.02 EUR...
Kind regards
robert
···
On Thu, Apr 26, 2012 at 1:47 PM, Michel Demazure <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1058456:
What does the real code look like?
One example :
def create\_report
report = @recipe\.run\_with\_logger\(@parameter\_values\)
if report
@report = report
J2R\.logger\.info\("report created"\)
bottom\_message "Nombre de lignes \#\{@report\.size\}"
else
J2R\.logger\.error\("error creating report"\)
bottom\_message "Erreur à la création du rapport"
end
end
On Thu, Apr 26, 2012 at 1:47 PM, Michel Demazure <lists@ruby-forum.com> > wrote:
J2R.logger.info("report created")
bottom_message "Nombre de lignes #{@report.size}"
else
J2R.logger.error("error creating report")
bottom_message "Erreur la cration du rapport"
end
end
Looks perfectly OK to me. Creating two additional methods seems like
a lot of overkill which hinders readability. My 0.02 EUR...
Kind regards
robert
Glad you agree ! reek can be overstuffed.
(I guess you are somewhere farther on the Loire. Sun in Tours for the
time being...).