Skip to content

Commit

Permalink
Adjust for Enumerator.new deprecation.
Browse files Browse the repository at this point in the history
  • Loading branch information
trans committed Nov 21, 2013
1 parent bc8f0fd commit 8575ec9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ostruct2.rb
Expand Up @@ -322,7 +322,9 @@ def to_h
# @return [Enumerator]
#
def to_enum
::Enumerator.new(self, :each!)
# Why has Ruby 2 deprecated this form?
#::Enumerator.new(self, :each!)
::Kernel.instance_method(:to_enum).bind(self).call(:each!)
end

#
Expand Down

0 comments on commit 8575ec9

Please sign in to comment.