Class: Numeric
Overview
Additional Numeric functionality
Instance Method Summary collapse
-
#blank? ⇒ true, false
Check if digit is blank 0.blank? => true 1.blank? => false.
-
#present? ⇒ true, false
Object isn’t blank.
-
#to_price! ⇒ String
Convert numeric price to string price with preferred view.
Instance Method Details
#blank? ⇒ true, false
Check if digit is blank 0.blank? => true 1.blank? => false
15 16 17 18 |
# File 'lib/marfa/helpers/classes/numeric.rb', line 15 def blank? return true if zero? false end |
#present? ⇒ true, false
Object isn’t blank
22 23 24 |
# File 'lib/marfa/helpers/classes/numeric.rb', line 22 def present? !blank? end |
#to_price! ⇒ String
Convert numeric price to string price with preferred view
7 8 9 |
# File 'lib/marfa/helpers/classes/numeric.rb', line 7 def to_price! self.to_s.to_price! end |