active_object 5.8.9 → 5.8.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/active_object/array.rb +5 -0
- data/lib/active_object/hash.rb +4 -0
- data/lib/active_object/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 793a265435e94323c9edf1a85958711c6b68714b56db7716e35f3bd781225183
|
4
|
+
data.tar.gz: 1acc0c3a73bb3a33b7c219e56d63409471596a40bd7304fd5595b6a59854baae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c863c4fd63eeddd709bfde59326b94bb9f57a81df7957ca5c8a1f4ea95e4b27eb8dc7cd3c29a38f9f17c9536d80479b8634e3d33589a25ff8d0c3d0f8760a44b
|
7
|
+
data.tar.gz: 2140a08d8e9769b0859e1156c699e391cba021ff139fcb8c3a789caf749aa640a9df6465dbc87db1455a84a3c79d49971702cb65498acf65bc10f4244454cf0f
|
data/README.md
CHANGED
@@ -291,6 +291,13 @@ end
|
|
291
291
|
'this is a test'.split(' ').strip #=> ['this', 'is', 'a', 'test']
|
292
292
|
```
|
293
293
|
|
294
|
+
**Swap:**
|
295
|
+
`swap` switches places of two elements.
|
296
|
+
|
297
|
+
```ruby
|
298
|
+
[1, 2, 3].swap(0, 2) #=> [3, 2, 1]
|
299
|
+
```
|
300
|
+
|
294
301
|
**To:**
|
295
302
|
`to` returns the beginning of the array up to position.
|
296
303
|
|
@@ -654,6 +661,15 @@ h1.dig(:a, :b, :c) #=> :d
|
|
654
661
|
{ :foo => 'foo', :baz => 'baz', :bar => 'bar' }.except(:baz, :bar) #=> { :foo => 'foo' }
|
655
662
|
```
|
656
663
|
|
664
|
+
**Extract:**
|
665
|
+
`extract!` removes and returns the key/value pairs matching the given keys.
|
666
|
+
|
667
|
+
```ruby
|
668
|
+
{}.extract!(:foo) #=> {}
|
669
|
+
{ foo: 'foo', baz: 'baz', bar: 'bar' }.extract!(:foo) #=> { foo: 'foo' }
|
670
|
+
|
671
|
+
```
|
672
|
+
|
657
673
|
**Hmap:**
|
658
674
|
`hmap` and `hmap!` returns a hash that is transformed in place.
|
659
675
|
|
data/lib/active_object/array.rb
CHANGED
data/lib/active_object/hash.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.8.
|
4
|
+
version: 5.8.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|