attrify 0.4.0 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/attrify/operation_set.rb +1 -1
- data/lib/attrify/version.rb +1 -1
- data/lib/attrify.rb +3 -7
- 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: 58d0a59c3a30916f7c2f2d346f1eead1ce97b39e23934f6ac7e669e338e15531
|
4
|
+
data.tar.gz: c33b953f8bb37eebacabd5d11dad29bed9d8fed7b99fd045321907110edc17ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74394d83abb22e261a9b037a6b01fe5f93802671f0fd77d4a49dd02239377934fdff9a80633769b1ddea210687e7b6861ecf14778d08fdbaecbbd45122249905
|
7
|
+
data.tar.gz: 3ac32800bf8284fe8f5c95b237026f61613f2b7749b9499dd52a826b6d6ceeffd8f0476fc5ebacb834c1a7ef0caee2005b2a938da8bedc353cacefdbedc68c4c
|
@@ -39,7 +39,7 @@ module Attrify
|
|
39
39
|
|
40
40
|
@operations = run_procs_on(@operations, instance)
|
41
41
|
@result = cache_result(@operations)[:value]
|
42
|
-
@result = @result.dig(*keys)
|
42
|
+
@result = @result.dig(*keys) || {}
|
43
43
|
if @result.present?
|
44
44
|
if @result.has_key?(:attributes)
|
45
45
|
@result = @result[:attributes]
|
data/lib/attrify/version.rb
CHANGED
data/lib/attrify.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require_relative "attrify/version"
|
4
4
|
require_relative "attrify/variant_registry"
|
5
5
|
require_relative "attrify/parser"
|
6
|
-
|
7
6
|
require_relative "attrify/dsl/engine"
|
8
7
|
|
9
8
|
module Attrify
|
@@ -30,15 +29,12 @@ module Attrify
|
|
30
29
|
end
|
31
30
|
end
|
32
31
|
end
|
32
|
+
|
33
33
|
include Helpers
|
34
|
+
|
34
35
|
def attribs(slot: :main, **args)
|
35
36
|
@attr_options ||= {}
|
36
|
-
|
37
|
-
new_arguments = if slot == :main
|
38
|
-
args
|
39
|
-
else
|
40
|
-
{slot => args}
|
41
|
-
end
|
37
|
+
new_arguments = (slot == :main) ? args : {slot => args}
|
42
38
|
|
43
39
|
merged_arguments = deep_merge_hashes(@attr_options, new_arguments)
|
44
40
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attrify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hector Medina Fetterman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|