Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Includes:
- Prawn::Measurements
- Defined in:
- lib/prawn/measurement_extensions.rb
Overview
Core extensions for Prawn::Measurements.
This mainly enables measurements DSL.
You have to explicitly require “prawn/measurement_extensions” to enable these.
require 'prawn/measurement_extensions'
12.mm
2.cm
0.5.in
4.yd + 2.ft
Experimental API collapse
-
#cm ⇒ Number
Convert from centimeters to points.
-
#dm ⇒ Number
Convert from decimeters to points.
-
#ft ⇒ Number
Convert from feet to points.
-
#in ⇒ Number
Convert from inches to points.
-
#m ⇒ Number
Convert from meters to points.
-
#mm ⇒ Number
Convert from millimeters to points.
-
#pt ⇒ Number
Convert from points to points.
-
#yd ⇒ Number
Convert from yards to points.
Stable API collapse
-
#cm2mm(cm) ⇒ Number
included
from Prawn::Measurements
Convert centimeter to millimeters.
-
#cm2pt(cm) ⇒ Number
included
from Prawn::Measurements
Convert centimeters to points.
-
#dm2mm(dm) ⇒ Number
included
from Prawn::Measurements
Convert decimeters to millimeters.
-
#dm2pt(dm) ⇒ Number
included
from Prawn::Measurements
Convert decimeters to points.
-
#ft2in(ft) ⇒ Number
included
from Prawn::Measurements
Convert feet to inches.
-
#ft2pt(ft) ⇒ Number
included
from Prawn::Measurements
Convert feet to points.
-
#in2pt(inch) ⇒ Number
included
from Prawn::Measurements
Convert inches to points.
-
#m2mm(m) ⇒ Number
included
from Prawn::Measurements
Convert meters to millimeters.
-
#m2pt(m) ⇒ Number
included
from Prawn::Measurements
Convert meters to points.
-
#mm2pt(mm) ⇒ Number
included
from Prawn::Measurements
Convert millimeters to points.
-
#pt2mm(pt) ⇒ Number
included
from Prawn::Measurements
Convert points to millimeters.
-
#pt2pt(pt) ⇒ Number
included
from Prawn::Measurements
Convert points to points.
-
#yd2in(yd) ⇒ Number
included
from Prawn::Measurements
Convert yards to inches.
-
#yd2pt(yd) ⇒ Number
included
from Prawn::Measurements
Convert yards to points.
Instance Method Details
#cm ⇒ Number
Convert from centimeters to points.
Source Code
37 | def cm |
38 | cm2pt(self) |
39 | end
|
#cm2mm(cm) ⇒ Number Originally defined in module Prawn::Measurements
Convert centimeter to millimeters.
#cm2pt(cm) ⇒ Number Originally defined in module Prawn::Measurements
Convert centimeters to points.
#dm ⇒ Number
Convert from decimeters to points.
Source Code
44 | def dm |
45 | dm2pt(self) |
46 | end
|
#dm2mm(dm) ⇒ Number Originally defined in module Prawn::Measurements
Convert decimeters to millimeters.
#dm2pt(dm) ⇒ Number Originally defined in module Prawn::Measurements
Convert decimeters to points.
#ft ⇒ Number
Convert from feet to points.
Source Code
72 | def ft |
73 | ft2pt(self) |
74 | end
|
#ft2in(ft) ⇒ Number Originally defined in module Prawn::Measurements
Convert feet to inches.
#ft2pt(ft) ⇒ Number Originally defined in module Prawn::Measurements
Convert feet to points.
#in ⇒ Number
Convert from inches to points.
Source Code
58 | def in |
59 | in2pt(self) |
60 | end
|
#in2pt(inch) ⇒ Number Originally defined in module Prawn::Measurements
Convert inches to points.
#m ⇒ Number
Convert from meters to points.
Source Code
51 | def m |
52 | m2pt(self) |
53 | end
|
#m2mm(m) ⇒ Number Originally defined in module Prawn::Measurements
Convert meters to millimeters.
#m2pt(m) ⇒ Number Originally defined in module Prawn::Measurements
Convert meters to points.
#mm ⇒ Number
Convert from millimeters to points.
Source Code
30 | def mm |
31 | mm2pt(self) |
32 | end
|
#mm2pt(mm) ⇒ Number Originally defined in module Prawn::Measurements
Convert millimeters to points.
#pt ⇒ Number
Convert from points to points.
Source Code
79 | def pt |
80 | pt2pt(self) |
81 | end
|
#pt2mm(pt) ⇒ Number Originally defined in module Prawn::Measurements
Convert points to millimeters.
#pt2pt(pt) ⇒ Number Originally defined in module Prawn::Measurements
Convert points to points. For completeness.
#yd ⇒ Number
Convert from yards to points.
Source Code
65 | def yd |
66 | yd2pt(self) |
67 | end
|
#yd2in(yd) ⇒ Number Originally defined in module Prawn::Measurements
Convert yards to inches.
#yd2pt(yd) ⇒ Number Originally defined in module Prawn::Measurements
Convert yards to points.