Sha256: 3628042b124918cfec0c090a618dc60f2ffd193b9937d41b37061ecda03c11f2

Contents?: true

Size: 524 Bytes

Versions: 3

Compression:

Stored size: 524 Bytes

Contents

require_relative '../constants'

module Squib
  class Deck

    # DSL method. See http://squib.readthedocs.io
    def inches(n)
      @dpi * n.to_f
    end

    # DSL method. See http://squib.readthedocs.io
    def points(n)
      @dpi / Squib::POINTS_PER_IN * n.to_f
    end

    # DSL method. See http://squib.readthedocs.io
    def cm(n)
      @dpi * Squib::INCHES_IN_CM * n.to_f
    end

    # DSL method. See http://squib.readthedocs.io
    def mm(n)
      @dpi * Squib::INCHES_IN_CM * n.to_f / 10.0
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
squib-0.15.2 lib/squib/api/units.rb
squib-0.15.1 lib/squib/api/units.rb
squib-0.14.2 lib/squib/api/units.rb