Class: Util
- Inherits:
-
Object
- Object
- Util
- Defined in:
- lib/util.rb
Class Method Summary collapse
- .cm_to_px(cm) ⇒ Object
- .is_number?(object) ⇒ Boolean
- .number_format(number) ⇒ Object
- .trans_y(off, y) ⇒ Object
Class Method Details
.cm_to_px(cm) ⇒ Object
2 3 4 |
# File 'lib/util.rb', line 2 def Util.cm_to_px(cm) return cm / 2.5 * 72 end |
.is_number?(object) ⇒ Boolean
10 11 12 |
# File 'lib/util.rb', line 10 def Util.is_number?(object) true if Float(object) rescue false end |
.number_format(number) ⇒ Object
14 15 16 |
# File 'lib/util.rb', line 14 def Util.number_format(number) '%.2f' % number.to_f end |
.trans_y(off, y) ⇒ Object
6 7 8 |
# File 'lib/util.rb', line 6 def Util.trans_y(off, y) 720 - off - y end |