lib/dottie.rb in dottie-0.0.2 vs lib/dottie.rb in dottie-0.0.3
- old
+ new
@@ -137,11 +137,11 @@
key_parts = Dottie.key_parts(key)
if key_parts.size > 1
key = Dottie.build_key(key_parts[0..-2])
obj = Dottie.get(obj, key)
end
- if obj.is_a?(Array) && key_parts.last.is_a?(Fixnum)
+ if obj.is_a?(Array) && key_parts.last.is_a?(Integer)
obj.delete_at(key_parts.last)
else
obj.delete(key_parts.last)
end
else
@@ -239,10 +239,10 @@
parts.each_with_index do |part, i|
case part
when String
key << '.' unless i == 0
key << part
- when Fixnum
+ when Integer
key << "[#{part}]"
end
end
key
end