Guest User

Untitled

a guest
Jul 16th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1.  
  2. class << self
  3. attr_accessor :username, :password, :host_format, :domain_format, :protocol, :port
  4.  
  5. def authenticate(username, password)
  6. @username = username
  7. @password = password
  8. self::Base.user = username
  9. self::Base.password = password
  10. resources.each do |klass|
  11. klass.site = klass.site_format % (host_format % [protocol, domain_format % username, ":#{port}"])
  12. end
  13. end
  14.  
  15. def resources
  16. @resources ||= []
  17. end
  18. end
Add Comment
Please, Sign In to add comment