Module: TypographicUnit

Defined in:
lib/typographic-unit.rb,
lib/typographic-unit/q.rb,
lib/typographic-unit/gou.rb,
lib/typographic-unit/inch.rb,
lib/typographic-unit/pica.rb,
lib/typographic-unit/unit.rb,
lib/typographic-unit/meter.rb,
lib/typographic-unit/cicero.rb,
lib/typographic-unit/version.rb,
lib/typographic-unit/big-point.rb,
lib/typographic-unit/jis-point.rb,
lib/typographic-unit/tex-point.rb,
lib/typographic-unit/centimeter.rb,
lib/typographic-unit/millimeter.rb,
lib/typographic-unit/didot-point.rb,
lib/typographic-unit/scaled-point.rb,
lib/typographic-unit/american-point.rb,
lib/typographic-unit/postscript-point.rb

Overview

TypographicUnit is a namespece for unit classes.

Defined Under Namespace

Classes: AmericanPoint, BigPoint, Centimeter, Cicero, DidotPoint, Gou, Inch, JISPoint, Meter, Millimeter, Pica, PostScriptPoint, Q, ScaledPoint, TeXPoint, Unit

Constant Summary collapse

TABLE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Hash.new
VERSION =

Version number of typographic-unit.

"0.2.0"

Class Method Summary collapse

Class Method Details

.initObject

Initialize typographic-unit. This makes unit methods for Numeric.



7
8
9
10
11
12
13
14
15
# File 'lib/typographic-unit.rb', line 7

def self.init
  TABLE.values.each do |unit|
    ::Numeric.instance_eval do
      define_method(unit.short) do
        unit.new(self)
      end
    end
  end
end