File: measurement_extensions.rb

package info (click to toggle)
ruby-prawn 2.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,380 kB
  • sloc: ruby: 15,820; sh: 43; makefile: 20
file content (51 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# frozen_string_literal: true

# measurement_extensions.rb: Core extensions for Prawn::Measurements
#
# Copyright December 2008, Florian Witteler.  All Rights Reserved.
#
# This is free software. Please see the LICENSE and COPYING files for details.

require_relative 'measurements'

# @group Stable API

class Numeric
  include Prawn::Measurements
  # prawns' basic unit is PostScript-Point
  # 72 points per inch

  # @group Experimental API

  def mm
    mm2pt(self)
  end

  def cm
    cm2pt(self)
  end

  def dm
    dm2pt(self)
  end

  def m
    m2pt(self)
  end

  def in
    in2pt(self)
  end

  def yd
    yd2pt(self)
  end

  def ft
    ft2pt(self)
  end

  def pt
    pt2pt(self)
  end
end