diff options
author | Daniel Doubrovkine (dB.) @dblockdotorg <dblock@dblock.org> | 2018-09-22 20:57:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-22 20:57:38 -0400 |
commit | 0235a18c14365b69773f99312bad590d0e66ee2d (patch) | |
tree | d28d44c8f5ad01c7dba8aaf49f593bfb6d954195 | |
parent | 7ed267b64c03aaef32bbb756a21a18fd2d4504f0 (diff) | |
parent | 12ae69adf3ec280576fd55d5f0c6a6d0cc107567 (diff) | |
download | hashie-0235a18c14365b69773f99312bad590d0e66ee2d.tar.gz |
Merge pull request #463 from alexandergraul/readability
Use == instead of <= in build_coercion
-rw-r--r-- | lib/hashie/extensions/coercion.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hashie/extensions/coercion.rb b/lib/hashie/extensions/coercion.rb index 704343e..e3f5011 100644 --- a/lib/hashie/extensions/coercion.rb +++ b/lib/hashie/extensions/coercion.rb @@ -159,10 +159,10 @@ module Hashie def build_coercion(type) if type.is_a? Enumerable - if type.class <= ::Hash + if type.class == ::Hash type, key_type, value_type = type.class, *type.first build_hash_coercion(type, key_type, value_type) - else # Enumerable but not Hash: Array, Set + else value_type = type.first type = type.class build_container_coercion(type, value_type) |