Sha256: 7a2ded7890698694552be861bcb33e8d15c8144ab80c67e2f14b7c94e4c5ff67

Contents?: true

Size: 334 Bytes

Versions: 6

Compression:

Stored size: 334 Bytes

Contents

class Forgery::Monetary < Forgery

  def self.formatted_money(options={})
    "$%1.2f" % money(options)
  end

  def self.money(options={})
    options = {:max => 10,
               :min => 0}.merge(options)

    value = Forgery::Extend((options[:min] * 100)..(options[:max] * 100)).random
    "%1.2f" % (value.to_f / 100)
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
forgery-0.8.1 lib/forgery/forgery/monetary.rb
forgery-0.7.0 lib/forgery/forgery/monetary.rb
forgery-0.6.0 lib/forgery/forgery/monetary.rb
forgery-0.5.0 lib/forgery/forgery/monetary.rb
forgery-0.4.4 lib/forgery/forgery/monetary.rb
forgery-0.4.3 lib/forgery/forgery/monetary.rb