lib/99_game.rb in 99_game-1.2.1 vs lib/99_game.rb in 99_game-1.3.0

- old
+ new

@@ -1,8 +1,8 @@ # Tests if obj is not nil. def not_nil?(obj) - if obj.nil + if obj.nil? return false else return true end end @@ -11,10 +11,10 @@ abbrev = {"$".to_sym => "Joker", K: "King", J: "Jack", Q: "Queen", A: "Ace"} if input == input.capitalize return input.to_i elsif not_nil? abbrev[input.capitalize.to_sym] return abbrev[input.capitalize.to_sym] - elsif input.nil || input == String.new + elsif input.nil? || input == String.new raise CardError, "Input not allowed" else return input.capitalize end end