lib/dottie/methods.rb in dottie-0.0.1 vs lib/dottie/methods.rb in dottie-0.0.2
- old
+ new
@@ -54,9 +54,34 @@
wrapped_object_or_self.fetch(key, &block)
end
end
end
+ ##
+ # Deletes the value at the specified key and returns it.
+
+ def delete(key)
+ if Dottie.dottie_key?(key)
+ Dottie.delete(wrapped_object_or_self, key)
+ else
+ super
+ end
+ end
+
+ ##
+ #
+
+ def dottie_flatten
+ Dottie.flatten(wrapped_object_or_self)
+ end
+
+ ##
+ #
+
+ def dottie_keys(intermediate = false)
+ Dottie.keys(wrapped_object_or_self, intermediate: intermediate)
+ end
+
private
##
# Gets the Hash or Array, whether it is a wrapped object (a
# Dottie::Freckle) or this object (self).