aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/struct.rb
blob: c2c30044f2b52aadcdb1090a220976ba6f3eab48 (plain) (blame)
1
2
3
4
5
6
#  Backport of Struct#to_h from Ruby 2.0
class Struct # :nodoc:
  def to_h
    Hash[members.zip(values)]
  end
end unless Struct.instance_methods.include?(:to_h)