Prawn::Measurements

Public Instance Methods

cm2mm(cm) click to toggle source
 ======                                                                       metric conversions
    # File lib/prawn/measurements.rb, line 11
11:     def cm2mm(cm)
12:       return cm*10
13:     end
cm2pt(cm) click to toggle source
    # File lib/prawn/measurements.rb, line 55
55:     def cm2pt(cm)
56:       return mm2pt(cm2mm(cm))
57:     end
dm2mm(dm) click to toggle source
    # File lib/prawn/measurements.rb, line 15
15:     def dm2mm(dm)
16:       return dm*100  
17:     end
dm2pt(dm) click to toggle source
    # File lib/prawn/measurements.rb, line 59
59:     def dm2pt(dm)
60:       return mm2pt(dm2mm(dm))
61:     end
ft2in(ft) click to toggle source
imperial conversions

from en.wikipedia.org/wiki/Imperial_units

    # File lib/prawn/measurements.rb, line 27
27:     def ft2in(ft)
28:       return ft * 12
29:     end
ft2pt(ft) click to toggle source
    # File lib/prawn/measurements.rb, line 43
43:     def ft2pt(ft)
44:       return in2pt(ft2in(ft))
45:     end
in2pt(inch) click to toggle source
PostscriptPoint-converisons
    # File lib/prawn/measurements.rb, line 39
39:     def in2pt(inch)
40:       return inch * 72    
41:     end
m2mm(m) click to toggle source
    # File lib/prawn/measurements.rb, line 19
19:     def m2mm(m)
20:       return m*1000
21:     end
m2pt(m) click to toggle source
    # File lib/prawn/measurements.rb, line 63
63:     def m2pt(m)
64:       return mm2pt(m2mm(m))
65:     end
mm2pt(mm) click to toggle source
    # File lib/prawn/measurements.rb, line 51
51:     def mm2pt(mm)
52:         return mm*(72 / 25.4)
53:     end
pt2mm(pt) click to toggle source
    # File lib/prawn/measurements.rb, line 67
67:     def pt2mm(pt)    
68:       return pt * 1 / mm2pt(1)# (25.4 / 72)
69:     end
yd2in(yd) click to toggle source
    # File lib/prawn/measurements.rb, line 31
31:     def yd2in(yd)
32:       return yd*36
33:     end
yd2pt(yd) click to toggle source
    # File lib/prawn/measurements.rb, line 47
47:     def yd2pt(yd)
48:       return in2pt(yd2in(yd))
49:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.