Guest User

Untitled

a guest
Jul 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. module TicketMaster::Provider
  2. # This is the Yoursystem Provider for ticketmaster
  3. module Redmine
  4. include TicketMaster::Provider::Base
  5. PROJECT_API = RedmineAPI::Project
  6.  
  7. # This is for cases when you want to instantiate using TicketMaster::Provider::Yoursystem.new(auth)
  8. def self.new(auth = {})
  9. TicketMaster.new(:redmine, auth)
  10. end
  11.  
  12. # declare needed overloaded methods here
  13. def authorize(auth = {})
  14. @authentication ||= TicketMaster::Authenticator.new(auth)
  15. auth = @authentication
  16. if (auth.server.blank? and auth.username.blank? and auth.password.blank?)
  17. raise "Please you should provide server, username and password"
  18. end
  19. RedmineAPI.authenticate(auth.server, auth.username, auth.password)
  20. end
  21. end
  22. end
Add Comment
Please, Sign In to add comment