Module: Bridge::Points

Defined in:
lib/bridge/points.rb,
lib/bridge/constants.rb,
lib/bridge/points/chicago.rb,
lib/bridge/points/duplicate.rb

Defined Under Namespace

Classes: Chicago, Duplicate

Constant Summary collapse

IMPS =
{
  0..10       => 0,
  20..40      => 1,
  50..80      => 2,
  90..120     => 3,
  130..160    => 4,
  170..210    => 5,
  220..260    => 6,
  270..310    => 7,
  320..360    => 8,
  370..420    => 9,
  430..490    => 10,
  500..590    => 11,
  600..740    => 12,
  750..890    => 13,
  900..1090   => 14,
  1100..1290  => 15,
  1300..1490  => 16,
  1500..1740  => 17,
  1750..1990  => 18,
  2000..2240  => 19,
  2250..2490  => 20,
  2500..2990  => 21,
  3000..3490  => 22,
  3500..3990  => 23,
  4000..15200 => 24
}

Class Method Summary collapse

Class Method Details

.imps(points_difference) ⇒ Object



3
4
5
6
7
# File 'lib/bridge/points.rb', line 3

def self.imps(points_difference)
  sign = (points_difference >= 0) ? 1 : -1
  IMPS.each { |range, imps| return (imps * sign) if range.include?(points_difference.abs) }
  nil
end