Skip to content

Commit

Permalink
style: use case instead of object.is_a?
Browse files Browse the repository at this point in the history
  • Loading branch information
santiagorodriguez96 committed Nov 4, 2024
1 parent a1717e4 commit 4ac971b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/webauthn/json_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ def to_hash_with_camelized_keys
end

def deep_camelize_keys(object)
if object.is_a?(Hash)
case object
when Hash
object.each_with_object({}) do |(key, value), result|
result[camelize(key)] = deep_camelize_keys(value)
end
elsif object.is_a?(Array)
when Array
object.map { |element| deep_camelize_keys(element) }
else
object
Expand Down

0 comments on commit 4ac971b

Please sign in to comment.