active_object 5.11.0 → 5.12.0
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/.irbrc +2 -2
- data/README.md +6 -6
- data/lib/active_object/enumerable.rb +2 -2
- data/lib/active_object/integer.rb +1 -1
- data/lib/active_object/object.rb +15 -1
- 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: 7cca57c6debc6ddba757fdd9ee484ad2d712ee112565f35e6a6ee8eac85f86fa
|
4
|
+
data.tar.gz: f8cef2544ef1de5a5b42a519766110c3bb0f52b2de25176dd8bbffe0ba0188a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe306fe0c7f05498d35fabf0ca63fe97ad42c6677c6ab4160e96fc87812258882d48fc108143fe60a8081659e780e4f81edfac3fe4edab7a7c52e86dfc72ffd2
|
7
|
+
data.tar.gz: d73c4d1148b1d3ef82662d7b42ed26310c511df020f9eb75f2d042a4a220813fc10e0923cd18f003195a3a1215cb5e13c47b219eeff6087928ebf165b4bf9681
|
data/.irbrc
CHANGED
@@ -25,8 +25,8 @@ railsrc_path = File.expand_path('.irbrc_rails')
|
|
25
25
|
if (ENV['RAILS_ENV'] || defined?(Rails)) && File.exist?(railsrc_path)
|
26
26
|
begin
|
27
27
|
load railsrc_path
|
28
|
-
rescue Exception =>
|
29
|
-
warn "Could not load: #{railsrc_path} because of #{
|
28
|
+
rescue Exception => e
|
29
|
+
warn "Could not load: #{railsrc_path} because of #{e}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/README.md
CHANGED
@@ -342,13 +342,13 @@ end
|
|
342
342
|
[2,2,2,3,3,4,2,2,1].cluster { |x| x } #=> [[2, 2, 2], [3, 3], [4], [2, 2], [1]]
|
343
343
|
```
|
344
344
|
|
345
|
-
**
|
346
|
-
`difference` returns the difference of a collection of numbers.
|
345
|
+
**Defference:**
|
346
|
+
`difference` returns the difference of a collection of numbers. (Renamed from: difference)
|
347
347
|
|
348
348
|
```ruby
|
349
|
-
[].
|
350
|
-
[].
|
351
|
-
[1,2,3].
|
349
|
+
[].defference #=> 0
|
350
|
+
[].defference(nil) #=> nil
|
351
|
+
[1,2,3].defference #=> -4
|
352
352
|
```
|
353
353
|
|
354
354
|
**Divisible:**
|
@@ -697,7 +697,7 @@ h1.dig(:a, :b, :c) #=> :d
|
|
697
697
|
`only_fill` and `only_fill!` returns only key/value pairs matching certain keys and any missing one.
|
698
698
|
|
699
699
|
```ruby
|
700
|
-
{}.
|
700
|
+
{}.only_fill(:foo) #=> { foo: nil }
|
701
701
|
{ :foo => 1, baz: 2 }.only_fill(:foo, :bar, placeholder: 0) #=> { foo: 1, bar: 0 }
|
702
702
|
```
|
703
703
|
|
@@ -75,9 +75,9 @@ if ActiveObject.configuration.autoload_enumerable
|
|
75
75
|
result || identity
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
78
|
+
def defference(identity = 0, &block)
|
79
79
|
if block_given?
|
80
|
-
map(&block).
|
80
|
+
map(&block).defference(identity)
|
81
81
|
else
|
82
82
|
inject { |key, val| key - val } || identity
|
83
83
|
end
|
data/lib/active_object/object.rb
CHANGED
@@ -146,4 +146,18 @@ module ActiveObject
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
|
-
|
149
|
+
if ActiveObject.configuration.autoload_object
|
150
|
+
Object.include(ActiveObject::Object)
|
151
|
+
|
152
|
+
class FalseClass
|
153
|
+
def to_i
|
154
|
+
0
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
class TrueClass
|
159
|
+
def to_i
|
160
|
+
1
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
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.
|
4
|
+
version: 5.12.0
|
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-
|
11
|
+
date: 2019-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|