This repository has been archived on 2023-12-11. You can view files and clone it, but cannot push or open issues or pull requests.
pgls/lib/pg_ldap_sync/compat.rb

11 lines
194 B
Ruby
Raw Normal View History

2022-12-02 10:05:42 +03:00
#!/usr/bin/env ruby
class Hash
2022-12-03 14:23:26 +03:00
# transform_keys was added in ruby-2.5
2022-12-02 10:05:42 +03:00
def transform_keys
map do |k, v|
[yield(k), v]
end.to_h
end unless method_defined? :transform_keys
end