spook_and_puff_money 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/spook_and_puff/money.rb +9 -3
  2. metadata +2 -2
@@ -193,11 +193,17 @@ module SpookAndPuff
193
193
  Money.new(@raw.round(places))
194
194
  end
195
195
 
196
- # Returns a currency formatted string.
196
+ # Returns a currency formatted string, set to two decimal places.
197
197
  #
198
+ # @param Hash opts
199
+ # @option opts [true, false] :prefix
198
200
  # @return String
199
- def to_s
200
- "$%.2f" % @raw.round(2)
201
+ def to_s(opts = {})
202
+ if opts.has_key?(:prefix) and opts[:prefix] == false
203
+ "%.2f" % @raw.round(2)
204
+ else
205
+ "$%.2f" % @raw.round(2)
206
+ end
201
207
  end
202
208
 
203
209
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spook_and_puff_money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-09 00:00:00.000000000 Z
13
+ date: 2013-10-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec