Class: Util

Inherits:
Object
  • Object
show all
Defined in:
lib/util.rb

Class Method Summary collapse

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

Returns:

  • (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