Defining case statement behaviour for Ruby class