Sha256: 799d2f7c3b0d77bd76204ab9875fb72da562c89b617fbdb3cfc828a2a3d91a95

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

require "money_in_words/integer"
# require "money_in_words/float"
require "money_in_words/money"
require "money_in_words/core_ext/integer"
require "money_in_words/core_ext/float"
require "money_in_words/version"

module MoneyInWords

  def self.to_words(num)
    case num
    when Integer
      MoneyInWords::Integer.new(num).to_words
    when Float
      MoneyInWords::Float.new(num).to_words
    end
  end

end

class String
  BLANK_RE = /\A[[:space:]]*\z/

  # A string is blank if it's empty or contains whitespaces only:
  #
  # ''.blank? # => true
  # ' '.blank? # => true
  # "\t\n\r".blank? # => true
  # ' blah '.blank? # => false
  #
  # Unicode whitespace is supported:
  #
  # "\u00a0".blank? # => true
  #
  # @return [true, false]
  def blank?
    BLANK_RE === self
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
money_in_words-1.0.1 lib/money_in_words.rb
money_in_words-1.0.0 lib/money_in_words.rb