def identify_class(obj)
case obj
when Hacker,Submission,TestCase,Contest
puts "It's a #{obj.class}!"
Abs()
The abs() function in ruby returns the absolute value of the integer. ex:
num1 = -21 => puts (num1).abs => 21
num2 = 23 => puts (num2).abs => 23
<=>()
String = "The Ruby Language"
string.split("").shuffle.join
Split
splits a string into pieces, returning an array of smaller strings.
Shuffle
%Q
Used as a string, it works as double quotes.
%Q[hello]
>> "Hello"
%q