dorian-to_struct 0.1.2 → 0.2.1

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: 49bd0ba3de934523a001e901d7337f9de71b7af79d1ad4f27d9fa708c412a516
4
- data.tar.gz: 2980eee293f67aff8b1fa406ad12c79ee276d16c3b7d5388f76e45c46d5540d1
3
+ metadata.gz: db03850d03b92fed3cddda6d0e70545b80edc8b7b634db08229c31d76972a3a8
4
+ data.tar.gz: 4b18f9c555086662520e15b715fe78dd7544929728e469b2aa4df5b4357d13bf
5
5
  SHA512:
6
- metadata.gz: 06f3cdacb5b1b7831d3e7ebcb04027631750e7b29566cd01489143880d1b9978118a3bdb030417581afb53187b99330a6beeee7c401d1deb8c22d1c4c7c4df5c
7
- data.tar.gz: f1f29b0affd933fe06733bfdff354782a59a94dba9d81cabb03832109cc3b0a82046502e5423dbf23005119dfe72896b4f7615a89994d954937edfae9e97fd30
6
+ metadata.gz: 995d22418293d53c30b2a5d98b54886b9f50d8bb44679fd554b508b0edc0242a30a9cff8a153d7cac816d5aeab3645f92ab8c97c3ced0c4c3108ff7a8f04fafe
7
+ data.tar.gz: 53f7e602ded31ce1c6dd98f0bbb84b0816e132baffeb1dc9c5329cc3c763a70f53124bf9a80663d28a0845be0c96b881e67c09be985e7d888453c243b16cdaf3
@@ -17,12 +17,10 @@ class Hash
17
17
  # user.events.first.name # => "Party"
18
18
  #
19
19
  def to_deep_struct
20
- Struct
21
- .new(*keys.map(&:to_sym))
22
- .new(
23
- *values.map do |value|
24
- value.respond_to?(:to_deep_struct) ? value.to_deep_struct : value
25
- end
26
- )
20
+ Struct.new(*keys.map(&:to_sym)).new(
21
+ *values.map do |value|
22
+ value.respond_to?(:to_deep_struct) ? value.to_deep_struct : value
23
+ end
24
+ )
27
25
  end
28
26
  end
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "core_ext/hash/struct"
2
4
  require_relative "core_ext/array/struct"
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "dorian/to_struct"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-to_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-12 00:00:00.000000000 Z
11
+ date: 2024-02-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Adds `#to_struct` and `#to_deep_struct` to Hash and Array
@@ -23,10 +23,11 @@ files:
23
23
  - lib/dorian/core_ext/array/struct.rb
24
24
  - lib/dorian/core_ext/hash/struct.rb
25
25
  - lib/dorian/to_struct.rb
26
- homepage: https://github.com/dorianmariefr/to_struct
26
+ homepage: https://github.com/dorianmariecom/to_struct
27
27
  licenses:
28
28
  - MIT
29
- metadata: {}
29
+ metadata:
30
+ rubygems_mfa_required: 'true'
30
31
  post_install_message:
31
32
  rdoc_options: []
32
33
  require_paths:
@@ -42,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
43
  - !ruby/object:Gem::Version
43
44
  version: '0'
44
45
  requirements: []
45
- rubygems_version: 3.2.22
46
+ rubygems_version: 3.5.3
46
47
  signing_key:
47
48
  specification_version: 4
48
49
  summary: Adds `#to_struct` and `#to_deep_struct` to Hash and Array