percentage 2.0.0 → 2.1.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: d73c317eceabcfd5b4b4f385f7def4664d5e7d827e925d101a306ba404170b69
4
- data.tar.gz: 3f225768beb51e4d8a743f2550be17119773ef392550369c2756d603bf448d68
3
+ metadata.gz: 21374fb1c476c85b4a4380ee15c3366aae81897a381c78eecfe4c439f4f333ab
4
+ data.tar.gz: f7be43bf545ffa5982a22a3da8ecd2692f114335a88be8090190b297d178b298
5
5
  SHA512:
6
- metadata.gz: 50b8c3ca5f618908e1ea75c2bb5076bf87a27d902781f96267f76954b9ec4481965a3dddc1a2f259b677a151bcf6bd39f48093e42307430335eb459b7270d3e7
7
- data.tar.gz: 16e31215f053b38882f6b96e49e8b5c13a106342d7fefc0f4a5a2e87e8ce60aae95f64d5d65b279c3ec2e04e86b6230ca136904140b93c3321079903732b02ac
6
+ metadata.gz: 2305a119de4fb3e426a20ca722cb3dcd14c46039d24e5b8c16328e74cbe43514c673fa20c83fb9d8f6d62d909e518e545f6a33be46a3ecc11ab6ffe3408b31f4
7
+ data.tar.gz: 6ac6258c6234e35a32b747f1317b725e84c3fdee226248b076d55fab34e4b2d43a54333de958eb6750640de3ae815a2a1657cbe279354f615dc3e1832f6ddec2
data/CHANGES.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 2.1.0
2
+
3
+ * Added Percentage#-@
4
+
5
+ * Added Percentage#positive?
6
+
7
+ * Added Percentage#negative?
8
+
1
9
  # 2.0.0
2
10
 
3
11
  * Added Percentage#to_d
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2022 TIMCRAFT
1
+ Copyright (c) 2012-2024 TIMCRAFT
2
2
 
3
3
  This is an Open Source project licensed under the terms of the LGPLv3 license.
4
4
  Please see <http://www.gnu.org/licenses/lgpl-3.0.html> for license text.
data/lib/percentage.rb CHANGED
@@ -103,6 +103,18 @@ class Percentage
103
103
  self.class.new(@value * n)
104
104
  end
105
105
 
106
+ def -@
107
+ self.class.new(-@value)
108
+ end
109
+
110
+ def positive?
111
+ @value.positive?
112
+ end
113
+
114
+ def negative?
115
+ @value.negative?
116
+ end
117
+
106
118
  protected
107
119
 
108
120
  def fractional_value
data/percentage.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'percentage'
3
- s.version = '2.0.0'
3
+ s.version = '2.1.0'
4
4
  s.license = 'LGPL-3.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percentage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby gem for working with percentages
14
14
  email:
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 3.3.3
49
+ rubygems_version: 3.4.10
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: See description