Permalink
Browse files

Merge pull request #34 from unpatioli/hash_check

verify_local_codepoints checks if arg is a Hash
  • Loading branch information...
2 parents 74b4af0 + b625b1d commit 35d6d5edea944186e3d16e65fb4de6ae28e0b6dd Russell Norris committed Feb 16, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/stringex/unidecoder.rb
@@ -115,7 +115,7 @@ def grouped_point(unpacked_character)
# Checks LOCAL_CODEPOINTS's Hash is in the format we expect before assigning it and raises
# instructive exception if not
def verify_local_codepoints(hash)
- pass_check = hash.all?{|key, value|
+ pass_check = hash.is_a?(Hash) && hash.all?{|key, value|
# Fuck a duck, eh?
[Symbol, String].include?(key.class) && value.is_a?(Hash) &&
value.keys.all?{|k| k.is_a?(String)} && value.values.all?{|v| v.is_a?(String)}

0 comments on commit 35d6d5e

Please sign in to comment.