Skip to content

Commit bf6b8a4

Browse files
committed
DateOfBirth#to_s should always return a string
1 parent 904f320 commit bf6b8a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/date_of_birth.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ def initialize(date_string)
66
end
77

88
def to_s
9-
return if match.nil?
10-
"%d-%02d-%02d" % [ match[:year], month(match[:month]), match[:day] ]
9+
return '' if match.nil?
10+
'%d-%02d-%02d' % [match[:year], month(match[:month]), match[:day]]
1111
end
1212

1313
private

0 commit comments

Comments
 (0)