fork(1) download
  1. params = {}
  2. params[:date] = "2017-010-29"
  3.  
  4. def get_correct_date
  5. if params != nil && params[:date] != nil
  6. dateArray = params[:date].split("-")
  7. if dateArray[1].length > 2
  8. dateArray[1] = dateArray[1].last(2)
  9. end
  10. params[:date] = dateArray[0] + "-" + dateArray[1] + "-" + dateArray[2]
  11. end
  12. end
  13.  
  14. get_correct_date
  15.  
  16. print params[:date]
  17.  
Runtime error #stdin #stdout #stderr 0s 28216KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:5:in `get_correct_date': undefined local variable or method `params' for main:Object (NameError)
	from prog.rb:14:in `<main>'