ruby-immutable-struct 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruby-immutable-struct.rb +6 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85d73514f08b01000998a15e95f33ba87a4c6217
4
- data.tar.gz: e41e2b39d4722c4cd0e7b97333826ab4553d93e8
3
+ metadata.gz: 6117ec164f5eeac76e57b32e4e12be46877f004d
4
+ data.tar.gz: e68c11492ed3363bb5bd99fcd14034ffa9ee09db
5
5
  SHA512:
6
- metadata.gz: fce8f9f4ae81eb44133ca3c739a8777af22ed29dcd141da7fc8ae340fc63da78d5f5ebd76114576dd5a359ee47d92381f345692f4e87ab737e33619de073d63e
7
- data.tar.gz: 523f5b5cef2a16c82065b2856760803f25f95f8797a44a16a3cb9bb15198138be5f10b268d410bf9b6d83056d8a54c95a221042e87e2e453a9d8531bfe14d334
6
+ metadata.gz: 12188b71d8b39e0e89fe55187b879da790de2d7d9039560871167c6e606ce3b93f6abd2b76375b0029a29a97a20aa5d1a56ba15f5a05d21e01c163cd85080cd4
7
+ data.tar.gz: 3c7a8cf0c2b2f022fa7204cd25215b85054ac5b0ead6012a5a658b173bf122f8e19195bdd34fef7e43413125a52453966e30c4256a913aa47f2a7e607133b98e
@@ -18,9 +18,15 @@ module RubyImmutableStruct
18
18
  #{attributes.map.with_index{ |a, i| "@#{a} = args[#{i}]" }.join(';')}
19
19
  end
20
20
 
21
+ after_initialize
22
+
21
23
  freeze
22
24
  end
23
25
 
26
+ def after_initialize
27
+ # Implementations may override this
28
+ end
29
+
24
30
  def merge(hash)
25
31
  merged_hash = to_h.merge!(hash)
26
32
  self.class.new(merged_hash)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-immutable-struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hooper