dodiez 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -3
- data/lib/dodiez/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 322dd8f8db4a0b5950a9d84dd5680d6badaf1699
|
4
|
+
data.tar.gz: e26ea73643b43dacf3b1c1e0d629f0c2559611e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef665f0ad81b01851fbda4a64ac62f33dac0cbdfbf2845e9c05d894156549cfd10810b0b8a03b56afed5e7260326401f44a1445a569245471d5148f325c10710
|
7
|
+
data.tar.gz: df6cafa54a7cc12295f95b7a2e32ba06f863b22bfe2b26129920104a3fa000143538e137466d2ab10359bb7c6521df55875878e2bb1b1ea49468dc0ee7f26fae
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Dodiez
|
2
2
|
|
3
|
-
|
3
|
+
This gem does the simple thing like "HashWithIndifferentAccess":
|
4
|
+
Implements a hash where keys :foo and "foo" are considered to be the same.
|
4
5
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,7 +22,32 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
To use it you have to modify your hash:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
your_hash = { qwe: 1, "qaz" => 2 }
|
29
|
+
your_modified_hash = CoolHash.new(your_hash)
|
30
|
+
```
|
31
|
+
|
32
|
+
After it you can access keys as symbol or string:
|
33
|
+
```ruby
|
34
|
+
your_modified_hash[:qwe] # 1
|
35
|
+
your_modified_hash["qwe"] # 1
|
36
|
+
|
37
|
+
your_modified_hash[:qaz] # 2
|
38
|
+
your_modified_hash["qaz"] # 2
|
39
|
+
```
|
40
|
+
|
41
|
+
If your hash has the same Symbol and String keys, it returns their values properly.
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
your_hash = { qwe: 1, "qwe" => 2 }
|
45
|
+
your_modified_hash = CoolHash.new(your_hash)
|
46
|
+
|
47
|
+
your_modified_hash[:qwe] # 1
|
48
|
+
your_modified_hash["qwe"] # 2
|
49
|
+
|
50
|
+
```
|
26
51
|
|
27
52
|
## Development
|
28
53
|
|
data/lib/dodiez/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dodiez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- superedriver
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|