structure 2.2.0 → 2.3.0

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: ba7cfab709c0800d232bcf33dc717b38d884b8ad3322602701247d9af39e4297
4
- data.tar.gz: efe78a271e6ddf19e641180bde8469f78f28c6e6a07fbe7b4cd2214460575336
3
+ metadata.gz: de5fcd89773ec6806567c78ea7eebb3867c128c6766149b81e07d82cc4d76ab1
4
+ data.tar.gz: 198774e8e6e3d4fea14f387a2862c0d88bd60923866a84a4bbdeaf0fd7be1cd1
5
5
  SHA512:
6
- metadata.gz: 499eb639627d1a27d8b80cbb3cab4e1725d41d108620f1166293b8c05c7c361945fb4680c8ac8ba1b56083d7b23cab14cc7ed0d09172f848149b7815b51ed016
7
- data.tar.gz: 5dbea4b6be05e2ed97885c8b3031ce0d643f70722ab5627c6a1b4bdf258607153d9a6cb28b12a710268de1df30872b8cab41ea39a87ca86262f8f9d25c6d926a
6
+ metadata.gz: 052042efbc411e8d09808f5bdfeb5d2994fd25ba45ddec8d45d06d3cc57b6dc2efd84ec840a20d601618bad494e2ba319c89a579f27e7de8f53c8d59849806be
7
+ data.tar.gz: f73e1be62de7fe8540a12f4bb47ded101cf7d7bc4971ab1dbcbbe6917754ee84a82e3cc7cfdb529fd1b1f4c07d62406caa6e7ed7ab5ab528b9f8bb061120d852
@@ -61,6 +61,17 @@ module Structure
61
61
  super
62
62
  end
63
63
 
64
+ def marshal_dump
65
+ attributes.values
66
+ end
67
+
68
+ def marshal_load(data)
69
+ @mutex = ::Thread::Mutex.new
70
+ attribute_names.zip(data).each do |key, val|
71
+ instance_variable_set(:"@#{key}", val)
72
+ end
73
+ end
74
+
64
75
  private
65
76
 
66
77
  def with_mutex(&block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Structure
4
- VERSION = '2.2.0'
4
+ VERSION = '2.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structure
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-25 00:00:00.000000000 Z
11
+ date: 2020-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -79,8 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
- rubygems_version: 3.0.3
82
+ rubygems_version: 3.1.2
83
83
  signing_key:
84
84
  specification_version: 4
85
- summary: Lazy parse data into memoized attributes
85
+ summary: Lazy-parse data into attributes in a thread-safe way
86
86
  test_files: []