switch/case statement

case x - Advanced techniques

simple as defining your own === method

class Success
  def self.===(item)
    item.status >= 200 && item.status < 300
  end
end
Written on November 20, 2019, Last update on October 28, 2021
ruby