Caution Case

Submitted By:
masassiez

Difficulty:
Elementary

Tags:
case statements, ranges

Code:
def caution_case(obj)
  case obj
  when obj
    true
  else
    false
  end
end

assert_equal caution_case( 1 ), true
assert_equal caution_case( [1, 2] ), true
assert_equal caution_case( {1=>2} ), true
assert_equal caution_case( (1..2) ), ___

Your Solution

Ruby 1.9.3

Back to Problems