Sha256: 13db4474ef1286d4ef55a24b9779212588ef9d361e7da9f8455e74365615f8c5

Contents?: true

Size: 657 Bytes

Versions: 38

Compression:

Stored size: 657 Bytes

Contents

module Helper
  class EnergyBandCalculator
    def self.domestic(number)
      case number
      when proc { |n| n <= 20 }
        "g"
      when 21..38
        "f"
      when 39..54
        "e"
      when 55..68
        "d"
      when 69..80
        "c"
      when 81..91
        "b"
      else
        "a"
      end
    end

    def self.commercial(number)
      case number
      when proc { |n| n <= -1 }
        "a+"
      when 0..25
        "a"
      when 26..50
        "b"
      when 51..75
        "c"
      when 76..100
        "d"
      when 101..125
        "e"
      when 126..150
        "f"
      else
        "g"
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
epb_view_models-1.0.21 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.20 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.19 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.18 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.17 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.16 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.15 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.14 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.13 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.12 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.11 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.10 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.9 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.8 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.7 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.6 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.5 lib/helper/energy_band_calculator.rb
epb_view_models-1.0.4 lib/helper/energy_band_calculator.rb