ruby_dig 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/README.md +14 -2
- data/lib/ruby_dig/version.rb +1 -1
- data/ruby_dig.gemspec +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: 168505593905c02218d0adf23bb69b692b9ec8d2
|
4
|
+
data.tar.gz: c9c66a5b8775a3ddbe2b001fb25842686583e1ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c428fb813468e3a0fc759a9beee4ca96653a5ddfaea3ce3e92f6db92c5b4a61792d3a141089990dd2aa9bba6f0acbd1201c674b320506b964c9c6660424ecaf
|
7
|
+
data.tar.gz: 9e619f51f7ee8a24d4d3ccd79ea0957774f8aee5d87dc9f721d38aebe4b6610898c7c6deca36437b06c63e13937503edf2d58ec9d48f54fff93b1d5526479046
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RubyDig
|
2
2
|
|
3
|
-
|
3
|
+
This gem adds Hash#dig and Array#dig from Ruby 2.3+ to earlier versions of Ruby. It is a no-op if you are running Ruby 2.3 or greater.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,7 +20,19 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
```
|
24
|
+
require 'ruby_dig'
|
25
|
+
|
26
|
+
response = {mom: {first: "Marge", last: "Bouvier"},
|
27
|
+
dad: {first: "Homer", last: "Simpson"},
|
28
|
+
kids: [
|
29
|
+
{first: "Bart", last: "Simpson"},
|
30
|
+
{first: "Lisa", last: "Simpson"}
|
31
|
+
]}
|
32
|
+
|
33
|
+
response.dig(:kids, 1, :first)
|
34
|
+
# => "Lisa"
|
35
|
+
```
|
24
36
|
|
25
37
|
## Contributing
|
26
38
|
|
data/lib/ruby_dig/version.rb
CHANGED
data/ruby_dig.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Colin Kelley"]
|
10
10
|
spec.email = ["colin@invoca.com"]
|
11
11
|
spec.summary = %q{Pure Ruby implementation of Array#dig and Hash#dig for Ruby < 2.3.}
|
12
|
-
spec.homepage = ""
|
12
|
+
spec.homepage = "https://github.com/Invoca/ruby_dig"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_dig
|
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
|
- Colin Kelley
|
@@ -68,7 +68,7 @@ files:
|
|
68
68
|
- lib/ruby_dig/version.rb
|
69
69
|
- ruby_dig.gemspec
|
70
70
|
- test/ruby_dig_test.rb
|
71
|
-
homepage:
|
71
|
+
homepage: https://github.com/Invoca/ruby_dig
|
72
72
|
licenses:
|
73
73
|
- MIT
|
74
74
|
metadata: {}
|