lib/provider/fogbugz.rb in ticketmaster-fogbugz-0.1.1 vs lib/provider/fogbugz.rb in ticketmaster-fogbugz-0.1.2
- old
+ new
@@ -16,14 +16,18 @@
# Providers must define an authorize method. This is used to initialize and set authentication
# parameters to access the API
def authorize(auth = {})
@authentication ||= TicketMaster::Authenticator.new(auth)
- if auth[:email].nil? || auth[:password].nil? || auth[:uri].nil?
- raise "Please provide email, password and uri"
+ auth = @authentication
+
+ unless auth.email? && auth.password? && auth.uri?
+ raise TicketMaster::Exception.new 'Please provide email, password and uri'
end
+
begin
- @fogbugz = ::Fogbugz::Interface.new(auth)
+ @fogbugz = ::Fogbugz::Interface.new(:email => auth.email,
+ :uri => auth.uri, :password => auth.password)
TicketMaster::Provider::Fogbugz.api = @fogbugz
@fogbugz.authenticate
rescue Exception => ex
warn "There was a problem authenticaticating #{ex.message}"
end