active_object 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -3
- data/lib/active_object/hash.rb +8 -0
- data/lib/active_object/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c942e7c9f4e256ef473d9d863b922fea1e9a82b
|
4
|
+
data.tar.gz: a12aec596189223192933d250f08a1dc37da5923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63e2b4785300b6fe06f1d6fb74b4f3596de62e23ca93159c82213e4189e4d9242108036013a6bda7f1d9b763939bd3a5ea33defbe3a955a087fc2d9a7844d655
|
7
|
+
data.tar.gz: 6002927f1bcbad6f64cab9ec696b7b5df5e413484d01e5111cccd7fe5f273b94c2ba07a03d9ac2e6c69c1c8a002ffc31d62307161cc145e329267bda7b80ade5
|
data/README.md
CHANGED
@@ -165,9 +165,9 @@ Or install it yourself as:
|
|
165
165
|
`to` returns the beginning of the array up to position. `Rails Safe`
|
166
166
|
|
167
167
|
```ruby
|
168
|
-
["1", "2", "3"].
|
169
|
-
["1", "2", "3"].
|
170
|
-
["1", "2", "3"].
|
168
|
+
["1", "2", "3"].to(0) #=> ["1"]
|
169
|
+
["1", "2", "3"].to(1) #=> ["1", "2"]
|
170
|
+
["1", "2", "3"].to(-1) #=> ["3"]
|
171
171
|
```
|
172
172
|
|
173
173
|
####To Sentence:####
|
@@ -452,6 +452,13 @@ h1.deep_merge(h2) #=> { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } }
|
|
452
452
|
{ :foo => 'foo', :baz => 'baz', :bar => 'bar' }.except(:baz, :bar) #=> { :foo => 'foo' }
|
453
453
|
```
|
454
454
|
|
455
|
+
####Hmap:####
|
456
|
+
`hmap` and `hmap!` returns a hash that is transformed in place.
|
457
|
+
|
458
|
+
```ruby
|
459
|
+
{ a: 1, b: 2, c: 3 }.hmap { |k, v| { k => v + 3 } } #=> { a: 4, b: 5, c: 6 }
|
460
|
+
```
|
461
|
+
|
455
462
|
####Nillify:####
|
456
463
|
`nillify` and `nillify!` transforms all blank values to nil.
|
457
464
|
|
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: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
120
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.6.2
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Gem for commonly used ruby object helpers.
|