This repository has been archived by the owner. It is now read-only.
any_merge
any_merge
Crystal Hash/Array
merge syntactic sugar.
Installation
Add this to your application's shard.yml
:
dependencies:
any_merge:
github: icyleaf/any_merge
branch: master
Usage
require "any_merge"
require "json"
json = JSON.parse(%Q{{"string":"foo","int":123,"float":1.23,"bool":true}}).as_h
new_json = json.any_merge({"string" => "bar", "nil" => nil })
puts new_json
# => {"string" => "bar", "int" => 123_i64, "float" => 1.23, "bool" => true, "nil" => nil}
json.any_merge!({"string" => "json"})
puts json
# => {"string" => "json", "int" => 123_i64, "float" => 1.23, "bool" => true}
Check spec code.
TODO
- Hash
- JSON::Any
- YAML::Any
- Hash(String | Symbol | Int32 | Int64, String | Int32 | Int64 | Float64 | Bool | Nil)
- Array
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/icyleaf/any_merge/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- icyleaf - creator, maintainer
Repository
any_merge
Owner
Statistic
- 1
- 1
- 0
- 0
- 0
- about 6 years ago
- June 21, 2018
License
MIT License
Links
Synced at
Thu, 21 Nov 2024 06:20:51 GMT
Languages