Commit a8acbc8b6f7a64a1372348cc62b8c796c7f077c8:
to_h backwards compatibility for Ruby 2.0
Branch: refs/heads/master
Author: Sam Ruby <[email protected]>
Committer: Sam Ruby <[email protected]>
Pusher: rubys <[email protected]>
------------------------------------------------------------
lib/whimsy/asf/auth.rb | +++++++
------------------------------------------------------------
7 changes: 7 additions, 0 deletions.
------------------------------------------------------------
diff --git a/lib/whimsy/asf/auth.rb b/lib/whimsy/asf/auth.rb
index 00c52bb..158c5a6 100644
--- a/lib/whimsy/asf/auth.rb
+++ b/lib/whimsy/asf/auth.rb
@@ -26,6 +26,13 @@ def each
yield pmc, ids.split(',')
end
end
+
+ unless Enumerable.instance_methods.include? :to_h
+ # backwards compatibility for Ruby versions <= 2.0
+ def to_h
+ Hash[self.to_a]
+ end
+ end
end
class Person