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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c15da6170447306522cb53c74db61937e5fc59d3e5a8619d40142c253be2ab7a
4
- data.tar.gz: 70c850497d0d5ceec7a8e5693e806494477303bde85030bd3da862e98eead7c8
3
+ metadata.gz: 58d0a59c3a30916f7c2f2d346f1eead1ce97b39e23934f6ac7e669e338e15531
4
+ data.tar.gz: c33b953f8bb37eebacabd5d11dad29bed9d8fed7b99fd045321907110edc17ab
5
5
  SHA512:
6
- metadata.gz: 512a4466eae20886eff9b71a615c7a08f251a3691fad2af0f8ec46ddec6fe9c039bdba4d27c56c61da909e95e5c8dfb4ecbde22f559aca151ce3c0a0fbbcfc7a
7
- data.tar.gz: 7f2726c8394496baa5e7e4e7f5a2b4a70d3ec81495e725e44291db36a77b439c6993626c08800a4697a4c5223dd522bed3027820053088050c9107b43d54aafd
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]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Attrify
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.5"
5
5
  end
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.0
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-13 00:00:00.000000000 Z
11
+ date: 2024-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport