Sha256: 1792646c3f1aa2e9f7ccbb328567884a6bfcf39d8346f6e1f4021488f3e75b19

Contents?: true

Size: 205 Bytes

Versions: 6

Compression:

Stored size: 205 Bytes

Contents

class Struct
  # Implement Struct#to_h for Ruby interpreters which don't have it
  # (such as MRI 1.9.3 and lower)
  unless method_defined?(:to_h)
    def to_h
      Hash[each_pair.to_a]
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/hamster-3.0.0/lib/hamster/core_ext/struct.rb
immutable-ruby-0.0.4 lib/immutable/core_ext/struct.rb
immutable-ruby-0.0.3 lib/immutable/core_ext/struct.rb
immutable-ruby-0.0.2 lib/immutable/core_ext/struct.rb
hamster-3.0.0 lib/hamster/core_ext/struct.rb
hamster-2.0.0 lib/hamster/core_ext/struct.rb