thomas_utils 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c7a26128e8f74017832ffb04f750ac8b3ffe0e4
4
- data.tar.gz: 0bbe301c720ba3ea86d32021c50ef93a3a484c4f
3
+ metadata.gz: 7d8863b06f5f048eab689b989c66dd14e4d29b4f
4
+ data.tar.gz: c5d8484310812422078cf2e147ef9caa1eb5c845
5
5
  SHA512:
6
- metadata.gz: 2fc4c8aa79311c01d78ea48ac4e320a604c94630d9541a86411c8fdb8342f3c8eb07169df745df481e231f1214c0cddabdc9f542c8da9694b08782ba6df0d187
7
- data.tar.gz: 2812ec24a201b64f98c45633ae0fa8ddb47e9163339d588047b8204ec2b1e1e2400aff678a0705b71c504807d1b075530078e503703a69cdaae0caef986b6238
6
+ metadata.gz: f7a8d86e988a34be705829a487d9404e8e385a03f6eb7bf8c06dec02f7a95cfb6da37fb80eac00eb4efb6e2074aa88e8718e9086005e701f7b447ae586018218
7
+ data.tar.gz: 99dc2ba2d5513d7148963fa76edebe30280900673158468ae393fdd6fbe392297f78c84e8ca9a06c378c7269dd80fdcbce6fb622658e6cd433dd09af97302703
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/lib/thomas_utils.rb CHANGED
File without changes
File without changes
File without changes
@@ -25,5 +25,14 @@ module ThomasUtils
25
25
  def to_s
26
26
  "#{@key}.#{@child}"
27
27
  end
28
+
29
+ def ==(rhs)
30
+ rhs.is_a?(KeyChild) && key == rhs.key && child == rhs.child
31
+ end
32
+ alias :eql? :==
33
+
34
+ def hash
35
+ to_s.hash
36
+ end
28
37
  end
29
38
  end
@@ -9,7 +9,7 @@ module ThomasUtils
9
9
  end
10
10
 
11
11
  def new_key(updated_key)
12
- KeyComparer.new(updated_key, @comparer)
12
+ KeyComparer.new(updated_key, comparer)
13
13
  end
14
14
 
15
15
  def quote(quote)
@@ -18,25 +18,26 @@ module ThomasUtils
18
18
  else
19
19
  "#{quote}#{key}#{quote}"
20
20
  end
21
- "#{quoted_key} #{@comparer}"
21
+ "#{quoted_key} #{comparer}"
22
22
  end
23
23
 
24
24
  def to_s
25
- "#{pretty_key} #{@comparer}"
25
+ "#{pretty_key} #{comparer}"
26
26
  end
27
27
 
28
28
  def ==(rhs)
29
- to_s == rhs.to_s
30
- end
31
-
32
- def eql?(rhs)
33
- self == rhs
29
+ rhs.is_a?(KeyComparer) && key == rhs.key && comparer == rhs.comparer
34
30
  end
31
+ alias :eql? :==
35
32
 
36
33
  def hash
37
34
  to_s.hash
38
35
  end
39
36
 
37
+ protected
38
+
39
+ attr_reader :comparer
40
+
40
41
  private
41
42
 
42
43
  def pretty_key
@@ -10,7 +10,20 @@ module ThomasUtils
10
10
  end
11
11
 
12
12
  def to_s
13
- "#{@key}['#{@index}']"
13
+ "#{key}['#{index}']"
14
14
  end
15
+
16
+ def ==(rhs)
17
+ rhs.is_a?(KeyIndexer) && key == rhs.key && index == rhs.index
18
+ end
19
+ alias :eql? :==
20
+
21
+ def hash
22
+ to_s.hash
23
+ end
24
+
25
+ protected
26
+
27
+ attr_reader :index
15
28
  end
16
- end
29
+ end
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thomas_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas RM Rogers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-28 00:00:00.000000000 Z
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: workers
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.3'
41
41
  description: |-
@@ -69,12 +69,12 @@ require_paths:
69
69
  - lib
70
70
  required_ruby_version: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ">="
72
+ - - '>='
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ">="
77
+ - - '>='
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []