lib/hexapdf/dictionary.rb in hexapdf-0.41.0 vs lib/hexapdf/dictionary.rb in hexapdf-0.44.0
- old
+ new
@@ -226,12 +226,12 @@
# Returns +true+ if the dictionary contains no entries.
def empty?
value.empty?
end
- # Returns a dup of the underlying hash.
- def to_h
- value.dup
+ # Returns a hash containing the preprocessed values (like in #[]).
+ def to_hash
+ value.each_with_object({}) {|(k, _), h| h[k] = self[k] }
end
private
# Ensures that the value is useful for a Dictionary and updates the object's value with