Skip to content

Instantly share code, notes, and snippets.

@Splat
Last active July 22, 2016 19:37
Show Gist options
  • Save Splat/eb508726be2899da0d0424a8d1c57811 to your computer and use it in GitHub Desktop.
Save Splat/eb508726be2899da0d0424a8d1c57811 to your computer and use it in GitHub Desktop.
# Description goes here!
#
# * *Params* :
# - ++ ->
# * *Headers* :
# - ++ ->
# * *Body* :
# - ++ ->
# * *Args* :
# - ++ ->
# * *Returns* :
# -
# * *Raises* :
# - ++ ->
#
def some_function_name
end
# An example of properly formatted RDoc given the above template
#
# * *Args* :
# - +foo+ -> a foo for you
# - +bar (optional)+ -> and a bar too
# * *Returns* :
# - A new instance of the Baz class
# * *Raises* :
# - +ArgumentError+ -> HTTP Status 400, invalid arguments based on type
#
def do_example foo bar
unless foo.is_a?(Number) raise ArgumentError.new("foo should be a number") end
unless bar.is_a?(String) raise ArgumentError.new("bar should be a string") end
# some computation
Baz.new
end
@Splat
Copy link
Author

Splat commented Apr 13, 2016

Basically this is here for reference because I always forget my nice RDoc formatting which gens some nice lists and formatting in the output of rake doc:app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment