Sha256: 38a1ae09ad20a877089d0cd7ecc91769c4470db612c82b82541775477b1960c4

Contents?: true

Size: 300 Bytes

Versions: 3

Compression:

Stored size: 300 Bytes

Contents

module DeadSimpleDb 

  module NegativeNumber

    def negative?
      casted < 0
    end

    def prepending_minus(string)
      raise "needs a block" unless block_given?
      string.sub!('-', '') if negative?
      string = yield(string)
      negative? ? '-' + string : string
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hungryblank-dead_simple_db-0.0.1 lib/dead_simple_db/negative_number.rb
hungryblank-dead_simple_db-0.0.2 lib/dead_simple_db/negative_number.rb
hungryblank-dead_simple_db-0.0.3 lib/dead_simple_db/negative_number.rb