Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zonuexe/ruby-hashize
Refinements classes of ruby's standard library as Hash
https://github.com/zonuexe/ruby-hashize
Last synced: about 2 months ago
JSON representation
Refinements classes of ruby's standard library as Hash
- Host: GitHub
- URL: https://github.com/zonuexe/ruby-hashize
- Owner: zonuexe
- License: other
- Created: 2013-10-30T03:55:11.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-30T03:55:51.000Z (about 11 years ago)
- Last Synced: 2024-10-27T05:23:06.558Z (about 2 months ago)
- Language: Ruby
- Homepage: http://rubygems.org/gems/hashize
- Size: 109 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Hashize
=======Refinements classes of ruby's standard library as Hash
Installation
------------Add this line to your application's Gemfile:
gem 'hashize'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hashize
Supports Classes
----------------### Standard Class
* `Struct`
### Standard Library
* `URI::Generic` (`uri`)
Usage
-----In your code:
```ruby
require 'hashize'
using Hashize::URI::Generic
using Hashize::Structuri = URI::parse('http://dt.zonu.me/').to_hash
#=> {:scheme => "http",
# :userinfo => nil,
# :host => "dt.zonu.me",
# :port => 80,
# :path => "/",
# :query => nil,
# :fragment => nil}MyStruct = Struct.new(:foo, :bar, :buz)
my = MyStruct.new('FOO', 'BAR', 'BUZ')
my.to_Hash
#=> {:foo => "FOO",
# :bar => "BAR",
# :buz => "BUZ"}
```Contributing
------------1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request