Sha256: 59a552a5de83ae0967ee16cdbaa4bafa1260983fefb7084c81e59e54b3a94a80

Contents?: true

Size: 551 Bytes

Versions: 6

Compression:

Stored size: 551 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

6 entries across 6 versions & 1 rubygems

Version Path
squib-0.15.3 lib/squib/api/units.rb
squib-0.15.0 lib/squib/api/units.rb
squib-0.14.3.pre1 lib/squib/api/units.rb
squib-0.14.1 lib/squib/api/units.rb
squib-0.14.0 lib/squib/api/units.rb
squib-0.14.beta1 lib/squib/api/units.rb