Module: NumericCheckExt
- Defined in:
- lib/sugar-high/numeric.rb
Instance Method Summary collapse
- #check_numeric!(arg) ⇒ Object
- #is_numeric?(arg) ⇒ Boolean (also: #numeric?)
Instance Method Details
#check_numeric!(arg) ⇒ Object
7 8 9 |
# File 'lib/sugar-high/numeric.rb', line 7 def check_numeric! arg raise ArgumentError, "Argument must be Numeric" if !is_numeric? arg end |
#is_numeric?(arg) ⇒ Boolean Also known as: numeric?
2 3 4 |
# File 'lib/sugar-high/numeric.rb', line 2 def is_numeric? arg arg.is_a? Numeric end |