Skip to content

Commit

Permalink
Merge pull request rsl#34 from unpatioli/hash_check
Browse files Browse the repository at this point in the history
verify_local_codepoints checks if arg is a Hash
  • Loading branch information
Russell Norris committed Feb 16, 2012
2 parents 74b4af0 + b625b1d commit 35d6d5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stringex/unidecoder.rb
Expand Up @@ -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)}
Expand Down

0 comments on commit 35d6d5e

Please sign in to comment.