Guest User

Untitled

a guest
May 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #THIS WORKS
  2.  
  3. ## inside the worker
  4.  
  5. def return_the_list
  6. AsteriskAcdList.new
  7. end
  8.  
  9.  
  10.  
  11.  
  12. ## in the library
  13.  
  14. class AsteriskAcdList < Array
  15.  
  16. def parse(e)
  17. target = self.select {|acd| acd.queue == e.queue }.first
  18. unless target.nil?
  19. target.route(e)
  20. else
  21.  
  22. self << AsteriskAcd.new(e)
  23. end
  24.  
  25. end
  26.  
  27.  
  28.  
  29. #THIS Doesnt
  30.  
  31.  
  32. ## inside the worker
  33.  
  34. def return_the_list
  35. array = Array.new
  36.  
  37. def array.parse(e)
  38. target = self.select {|acd| acd.queue == e.queue }.first
  39. unless target.nil?
  40. target.route(e)
  41. else
  42. self << AsteriskAcd.new(e)
  43. end
  44. end
  45.  
  46. array
  47. end
Add Comment
Please, Sign In to add comment