Client categorisation based on hourly payment
I like @SergeiiK's first solution, but we can make this more declarative:

GRADES = {
  germany: {
    "A" =&gt; 35...Float::INFINITY,
    "B" =&gt; 30...35,
    "C" =&gt; 25...30,
    "D" =&gt; 0...25,
  },
  sweden: {
    "A" =&gt; 400...Float::INFINITY,
    "B" =&gt; 350...400,
    "C" =&gt; 300...350,
    "D" =&gt; 0...300,
  },
}

def category_for(client)
  GRADES[client.country].find do |_, range|
    range.cover?(client.hourly_rate)
  end.first
end

Client = Struct.new(:country, :hourly_rate) # just for demonstration

p category_for(Client.new(:germany, 26))
# =&gt; "C"

p category_for(Client.new(:sweden, 7000))
# =&gt; "A"


You'd probably want to add some error handling to category_for for invalid inputs.

Note that the inner Hashes are Hashes for aesthetics only. Using Enumerable#find on a Hash will iterate over its key-value pairs one by one just as it would an array of key-value pairs ([ [ "A", 35...Float::INFINITY ], ... ]), making lookup O(n) instead of O(1) (ish) like normal Hash lookup. This is just prettier than nested arrays. This won't be as fast as a case solution, either, but unless you're, say, "grading" hundreds of thousands of clients at once you won't notice a difference.