Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class Foo
  2. def Bar(str)
  3. year = str[0..1].to_i + 2000
  4. month = str[2].ord - 48
  5. day = str[3].ord - 48
  6. hour = str[4].ord - 48
  7. min = str[5].ord - 48
  8. sec = str[6].ord - 48
  9.  
  10. # ...
  11. end
  12. end
  13.  
  14. class Foo
  15. def Bar
  16. ADJ = 48
  17. month = str[2].ord - ADJ
  18. day = str[3].ord - ADJ
  19. hour = str[4].ord - ADJ
  20. min = str[5].ord - ADJ
  21. sec = str[6].ord - ADJ
  22. # ...
  23. end
  24. end
  25.  
  26. adj = 48
  27.  
  28. module Foo
  29. XYZ = ...
  30.  
  31. def bar
  32. ...
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement