Add SomePairs#to_h for compatbility with Ruby 2.0+
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
.yardopts
Gemfile
MIT-LICENSE
README.md
Rakefile
to_h.gemspec

README.md

to_h

Build Status Gem Version

Description

Add SomePairs#to_h for compatibility with Ruby 2.0+
http://d.hatena.ne.jp/nagachika/20120416/ruby_trunk_changes_35337_35352

Features

Ruby 2.0+

  • Hash#to_h
  • Struct#to_h
  • ENV.to_h
  • NilClass#to_h
  • OpenStruct#to_h

Ruby 2.1+

  • Enumerable#to_h
  • Array#to_h

Usage

Basic

require 'to_h'

With OpenStruct

require 'ostruct'
require 'ostruct/to_h'

Requirements

Install

$ gem install to_h

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.