Sha256: ca5d3d4cd77db053fcfe38cb6f7d8edaa16228a98774f76c7e0af23afc79d570

Contents?: true

Size: 396 Bytes

Versions: 16

Compression:

Stored size: 396 Bytes

Contents

module NumericCheckExt
  def is_numeric? arg
    arg.is_a? Numeric
  end
  alias_method :numeric?, :is_numeric?

  def check_numeric! arg
    raise ArgumentError, "Argument must be Numeric" if !is_numeric? arg
  end  
end

module NumberDslExt   
  def thousand
    self * 1000
  end  

  def hundred
    self * 100
  end  
end

[Float, Numeric].each do |mod|
  mod.send :include, NumberDslExt
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sugar-high-0.6.3 lib/sugar-high/numeric.rb
sugar-high-0.6.2.1 lib/sugar-high/numeric.rb
sugar-high-0.6.1 lib/sugar-high/numeric.rb
sugar-high-0.6.0 lib/sugar-high/numeric.rb
sugar-high-0.5.5 lib/sugar-high/numeric.rb
sugar-high-0.5.4 lib/sugar-high/numeric.rb
sugar-high-0.5.3 lib/sugar-high/numeric.rb
sugar-high-0.5.1 lib/sugar-high/numeric.rb
sugar-high-0.5.0 lib/sugar-high/numeric.rb
sugar-high-0.4.9.5 lib/sugar-high/numeric.rb
sugar-high-0.4.9.3 lib/sugar-high/numeric.rb
sugar-high-0.4.9.2 lib/sugar-high/numeric.rb
sugar-high-0.4.9.1 lib/sugar-high/numeric.rb
sugar-high-0.4.9 lib/sugar-high/numeric.rb
sugar-high-0.4.8 lib/sugar-high/numeric.rb
sugar-high-0.4.7 lib/sugar-high/numeric.rb