You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This link of Chris Powell shows, how a method can be documented similar to javadoc (alternatively, evaluate, what rdoc can do for us).
At least for new methods, I should follow his design rules and document the method similar to his example:
# This is an example method commented the way I like. # It sums the three arguments and returns that value.## Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed# do eiusmod tempor incididunt ut labore et dolore magna aliqua. # Ut enim ad minim veniam, quis nostrud exercitation ullamco # laboris nisi ut aliquip ex ea commodo consequat.## * *Args* :# - +apples+ -> the number of apples# - +oranges+ -> the number of oranges# - +pears+ -> the number of pears# * *Returns* :# - the total number of fruit as an integer# * *Raises* :# - +ArgumentError+ -> if any value is nil or negative#defsum_fruit(apples,oranges,pears)raiseArgumentError,"No value can be absent"unless(apples.present? && oranges.present? && pears.present?)raiseArgumentError,"All values must be positive"unless(apples >= 0 && oranges >= 0 && pears >= 0)returnapples+oranges+pearsend
The rake doc:app task then creates a documentation like
The text was updated successfully, but these errors were encountered:
oveits
changed the title
Improve Documentation through
Improve Documentation through javadoc like task: rake doc:appMar 14, 2016
oveits
changed the title
Improve Documentation through javadoc like task: rake doc:app
Add javadoc like documentation (task: rake doc:app)
Mar 14, 2016
oveits
changed the title
Add javadoc like documentation (task: rake doc:app)
Add javadoc like documentation (rake doc:app)
Mar 14, 2016
This link of Chris Powell shows, how a method can be documented similar to javadoc (alternatively, evaluate, what rdoc can do for us).
At least for new methods, I should follow his design rules and document the method similar to his example:
The
rake doc:app
task then creates a documentation likeThe text was updated successfully, but these errors were encountered: