dorian-to_struct 0.2.0 → 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: 5ff4bcc973088303d25f8ef486b2fae5d2aa46dec8bdd0f50bd0995fbbb0e75d
4
- data.tar.gz: 0d324f9c5e6017beb0c51fc13f0475ebc41c9ea0d94656c095b51ee3b45be963
3
+ metadata.gz: db03850d03b92fed3cddda6d0e70545b80edc8b7b634db08229c31d76972a3a8
4
+ data.tar.gz: 4b18f9c555086662520e15b715fe78dd7544929728e469b2aa4df5b4357d13bf
5
5
  SHA512:
6
- metadata.gz: 2ade8dc21ed4f684eba66074b0684c039c877902d4d6ba166f98aa99d04cff9b706669e4cb45557f4b01e0c4aa989b9aa61a03f4f746923958cb8b711f675653
7
- data.tar.gz: d5b98217d2aa6d9e5510332607e224d67d01f2215288f07c31c59dca7adf724493c4dbc2e1258ae80f49cd0144fa79afcbc1981b5ef025162ef6938099e0b1b8
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.2.0
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-19 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,7 +23,7 @@ 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
29
  metadata:
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.2.22
46
+ rubygems_version: 3.5.3
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Adds `#to_struct` and `#to_deep_struct` to Hash and Array