Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Restructure simple_if to use TomDoc

  • Loading branch information...
commit bb81219b8e05d18706944371eee8a15439f0fe3c 1 parent 0a3f2df
Doug Ireton authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/ruby_katas/chapter02_control_flow.rb
14 lib/ruby_katas/chapter02_control_flow.rb
View
@@ -20,17 +20,17 @@
module Chapter02
class << self
- ##
+
# A kata to learn how to use simple "if" statements
#
- # @param [Fixnum] n number to evaluate
- # @return [Fixnum, NilClass] 1 if n == 1.
- # If you don't explicitly return a value in a method, it will return nil.
+ # In Ruby, the "then" statement isn't usually used, so just "if", not "if ... then"
+ # Also, notice that parenthesis around the condition, e.g. "n == 1" are optional
+ # and usually omitted in Ruby
#
- # @note In Ruby, the "then" statement isn't usually used, so just "if", not "if ... then"
- # Also, notice that parenthesis around the condition, e.g. "n == 1" are optional
- # and usually omitted in Ruby
+ # n - The Integer number to evaluate
#
+ # Returns 1 if n == 1.
+ # If you don't explicitly return a value in a method, it will return nil.
def simple_if(n)
# TODO: use a simple "if ... end" structure here
Please sign in to comment.
Something went wrong with that request. Please try again.