ruby-immutable-struct 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby-immutable-struct.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7754c81e29ded23e8bd3cf9564802c0ad78009a2
|
4
|
+
data.tar.gz: c4959dcf1b820d28faac4b143791b441787dca7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21ec58ffd29d618e6a4f82f9a402606648eeb53b8a2870362237182c4363cb7c1d02d3e8a857a947835ec649046bf774396f92ba3e8fa8dfe84c35147b1bdeae
|
7
|
+
data.tar.gz: 6d70901b359203958f8a85c26f4948bf0535ca2de69a17045cdd86fa880bbda7fdb13baacfb354846782c0399256d098366e376371e2a35438f8f93404f63a7c
|
@@ -40,6 +40,15 @@ module RubyImmutableStruct
|
|
40
40
|
[ #{attributes.map{ |a| "@#{a}" }.join(',')} ]
|
41
41
|
end
|
42
42
|
|
43
|
+
def ==(other)
|
44
|
+
#{attributes.map{ |a| "@#{a} == other.#{a}" }.join(' && ')}
|
45
|
+
end
|
46
|
+
alias :eql? :==
|
47
|
+
|
48
|
+
def hash
|
49
|
+
to_a.hash
|
50
|
+
end
|
51
|
+
|
43
52
|
def inspect
|
44
53
|
"#<#\{self.class.name} #\{to_a.map(&:inspect).join(',')}>"
|
45
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-immutable-struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hooper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: adam@adamhooper.com
|