Sha256: 28446fee9f3a9b725a89dc1e63d4ef4c6fb369cfbf674f6a80095d933365c4f4

Contents?: true

Size: 447 Bytes

Versions: 1

Compression:

Stored size: 447 Bytes

Contents

module Fitment
  MM_PER_INCH = 25.4

  def self.inches(mm)
    mm.to_f / MM_PER_INCH
  end

  def self.mm(inches)
    inches.to_f * MM_PER_INCH
  end

  # https://www.tiresandco.ca/tire-equivalence-advice.html
  # [min, ideal, ideal, max]
  # this is a simple linear model: y = a + bx; a = 55; b = 20
  # [min, min+10, min+20, min+30]
  def self.tire_widths(rim_width_in)
    Array.new(4) { |i| (55 + 20 * rim_width_in + i * 10).round }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fitment-0.1.1.1 lib/fitment.rb