textstat 0.1.9 → 1.0.0

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
  SHA256:
3
- metadata.gz: 88480347f6e6a1c232dc30a7ee14e4cf98154936e28a9fb2d1aaa6fe0f176aed
4
- data.tar.gz: bce6f0fc8222542dba6a8e0961d20fd3b68313571769f1cd7c7dd13c5fc28926
3
+ metadata.gz: 3b31ddd58d5ce5aa900acc19b5e93427193db6f80ff7b4006393e2247426057e
4
+ data.tar.gz: 631647fb90e3c0f1f55e48ff1a9c12a617e9dae3bef19fd956cead2bac54af06
5
5
  SHA512:
6
- metadata.gz: d3490d4920b60d1a6defa19eb80a2918bd92fafcf265b8f55aae50f617da88becaeba562a73fe20b91020f0ed21a2e912556c6cbb8314bc5f8210a8debcbe82c
7
- data.tar.gz: f4a7c7aba924df2005da79cf48a675e6d1f2655d56debe90590e748b56fdc1bccffa80ce245ba644d5fe0e5119d5b66159946569a05f715579bfaaa8185edb61
6
+ metadata.gz: 9a89c77ea00c51a00649db231ef5e5cbe8f72a8e92734d80d61cc04956cea53a2cc293823babf5185b79c397ff53f2893857caf2bd331ec4ef8dfc23f00cde57
7
+ data.tar.gz: c4577aa1d7fbb45f1408b04241d02d4da9a434130e88d89535fda7c61c6a56c6715d69dcf1d2a8b50111e42459077012719fc5bcc092884e69a94b673508a140
data/lib/counter.rb CHANGED
@@ -6,19 +6,19 @@ class Counter < Hash
6
6
  other.each_char { |e| self[e] += 1 } if other.is_a? String
7
7
  end
8
8
 
9
- def +(rhs)
10
- raise TypeError, "cannot add #{rhs.class} to a Counter" unless rhs.is_a? Counter
9
+ def +(other)
10
+ raise TypeError, "cannot add #{other.class} to a Counter" unless other.is_a? Counter
11
11
 
12
12
  result = Counter.new(self)
13
- rhs.each { |k, v| result[k] += v }
13
+ other.each { |k, v| result[k] += v }
14
14
  result
15
15
  end
16
16
 
17
- def -(rhs)
18
- raise TypeError, "cannot subtract #{rhs.class} to a Counter" unless rhs.is_a? Counter
17
+ def -(other)
18
+ raise TypeError, "cannot subtract #{other.class} to a Counter" unless other.is_a? Counter
19
19
 
20
20
  result = Counter.new(self)
21
- rhs.each { |k, v| result[k] -= v }
21
+ other.each { |k, v| result[k] -= v }
22
22
  result
23
23
  end
24
24