lib/active_object/hash.rb in active_object-1.1.0 vs lib/active_object/hash.rb in active_object-1.1.1
- old
+ new
@@ -51,11 +51,11 @@
end
end
unless defined?(Rails)
def except!(*keys)
- keys.each { |k| delete(k) }
+ keys.flatten.each { |k| delete(k) }
self
end
end
def nillify
@@ -74,11 +74,11 @@
dup.only!(*keys)
end
def only!(*keys)
hash = {}
- keys.each { |k| hash[k] = self[k] if self.has_key?(k) }
+ keys.flatten.each { |k| hash[k] = self[k] if self.has_key?(k) }
replace(hash)
end
def rename_keys(*keys)
dup.rename_keys!(*keys)
@@ -102,10 +102,10 @@
end
end
unless defined?(Rails)
def slice(*keys)
- keys.each_with_object(self.class.new) { |k, h| h[k] = self[k] if has_key?(k) }
+ keys.flatten.each_with_object(self.class.new) { |k, h| h[k] = self[k] if has_key?(k) }
end
end
unless defined?(Rails)
def slice!(*keys)
\ No newline at end of file