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.
“‘ruby 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.
37 38 39 |
# File 'lib/prawn/measurement_extensions.rb', line 37 def cm cm2pt(self) 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.
44 45 46 |
# File 'lib/prawn/measurement_extensions.rb', line 44 def dm dm2pt(self) 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.
72 73 74 |
# File 'lib/prawn/measurement_extensions.rb', line 72 def ft ft2pt(self) 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.
58 59 60 |
# File 'lib/prawn/measurement_extensions.rb', line 58 def in in2pt(self) end |
#in2pt(inch) ⇒ Number Originally defined in module Prawn::Measurements
Convert inches to points.
#m ⇒ Number
Convert from meters to points.
51 52 53 |
# File 'lib/prawn/measurement_extensions.rb', line 51 def m m2pt(self) 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.
30 31 32 |
# File 'lib/prawn/measurement_extensions.rb', line 30 def mm mm2pt(self) end |
#mm2pt(mm) ⇒ Number Originally defined in module Prawn::Measurements
Convert millimeters to points.
#pt ⇒ Number
Convert from points to points.
79 80 81 |
# File 'lib/prawn/measurement_extensions.rb', line 79 def pt pt2pt(self) 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.
65 66 67 |
# File 'lib/prawn/measurement_extensions.rb', line 65 def yd yd2pt(self) 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.