lib/farecalculator.rb
# Yuck, I don't like this but it's quicker
Yuck, I don't like this but it's quicker
Yuck I don ' t like this but it ' s quicker
def fare_table_to_str()
    string_output = "Special Zone Difference Fare Rate\n" +
                    "----------------------------------\n"
    @fareTableHash.keys.sort.each do |fareTableKey|
      fareTable = @fareTableHash[fareTableKey]
      fareTable.keys.sort.each do |fareKey|
        string_output += sprintf("%12d %10d %9d\n", fareTableKey, fareKey, fareTable[fareKey])
      end
    end
    string_output
  end
def fare_table_to_str ( ) string_output = "Special Zone Difference Fare Rate\n" + "----------------------------------\n" @fareTableHash . keys . sort . each do | fareTableKey | fareTable = @fareTableHash [ fareTableKey ] fareTable . keys . sort . each do | fareKey | string_output += sprintf ( "%12d %10d %9d\n" , fareTableKey , fareKey , fareTable [ fareKey ] ) end end string_output end
Yuck, I don't like this but it's quicker
Yuck I don ' t like this but it ' s quicker