gnucash 1.0.1 → 1.0.2

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.
data/lib/gnucash/value.rb CHANGED
@@ -59,6 +59,11 @@ module Gnucash
59
59
  end
60
60
  end
61
61
 
62
+ # Negate a Value
63
+ def -@
64
+ Value.new(-@val, @div)
65
+ end
66
+
62
67
  # Multiply a Value object
63
68
  # +other+ should be a Numeric
64
69
  def *(other)
@@ -1,4 +1,4 @@
1
1
  module Gnucash
2
2
  # gem version
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
@@ -51,6 +51,12 @@ module Gnucash
51
51
  c.should == 1.1
52
52
  end
53
53
 
54
+ it "allows negating a Value object" do
55
+ a = Value.new("123/100")
56
+ b = -a
57
+ b.to_s.should == "-1.23"
58
+ end
59
+
54
60
  it "allows multiplying a Value by a Numeric" do
55
61
  a = Value.new("100/100")
56
62
  b = 12
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnucash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-15 00:00:00.000000000 Z
12
+ date: 2013-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri