key_smith 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +3 -16
- data/lib/key_smith.rb +2 -3
- data/lib/key_smith/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: 06e0d2248a8ddf973b72a8a35fb181a7913286b6
|
4
|
+
data.tar.gz: 161aebccfc6d1b8b7775ce6533425e6277e24a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff9971f12ad9d9fc532886d703749cf58703eb585718b71df2e108493303761063546ba0a5fb4527b63a4d8faf9489f3878017d98d7380787f3c61c57e40fdc5
|
7
|
+
data.tar.gz: 9e619fea57f482acfbd5f7785a9c0485cdcf41d08450004f04aa451c00dd63a05b95af7f3b0b4e4211153694cbfea437623d6faa0f45bb2dcba2ae3b7eda6fef
|
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -28,23 +28,10 @@ require "key_smith"
|
|
28
28
|
```
|
29
29
|
|
30
30
|
### Translate
|
31
|
-
Translate key names using a map
|
31
|
+
Translate key names using a map with `#translate` or `#translate!`
|
32
32
|
|
33
33
|
```ruby
|
34
|
-
hash = { :mid => "56632", manDate => "2011-01-01" }
|
35
|
-
|
36
|
-
|
37
|
-
data.translate map
|
34
|
+
hash = { :mid => "56632", :manDate => "2011-01-01" }
|
35
|
+
hash.translate mid: :machine_id, manDate: :manufactured_at
|
38
36
|
# => { machine_id: "56632", manufactured_at: "2011-01-01" }
|
39
|
-
```
|
40
|
-
|
41
|
-
Translate on the same object
|
42
|
-
|
43
|
-
```ruby
|
44
|
-
hash = { firstName: "Philip", lastName: "Vieira" }
|
45
|
-
map = { firstName: :first_name, lastName: :last_name }
|
46
|
-
hash.translate! map
|
47
|
-
|
48
|
-
hash
|
49
|
-
# => { first_name: "Philip", last_name: "Vieira" }
|
50
37
|
```
|
data/lib/key_smith.rb
CHANGED
data/lib/key_smith/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: key_smith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Vieira
|
@@ -62,7 +62,7 @@ files:
|
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
64
|
- Gemfile
|
65
|
-
- LICENSE
|
65
|
+
- LICENSE
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
68
|
- key_smith.gemspec
|