Skip to content

Commit

Permalink
allow different authentication credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
newellista committed Jan 13, 2010
1 parent e36cec7 commit a7ff0b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/roart/connection.rb
Expand Up @@ -4,7 +4,7 @@
module Roart

module Connections
RequiredConfig = %w(server user pass)
RequiredConfig = %w(server)

end

Expand All @@ -20,7 +20,12 @@ def initialize(conf)
Roart::check_keys!(conf, Roart::Connections::RequiredConfig)
@conf = conf
end
end

def authenticate(user, pass)
@conf[:user] = user
@conf[:pass] = pass

@agent = login
add_methods!
end
Expand Down
4 changes: 4 additions & 0 deletions lib/roart/ticket.rb
Expand Up @@ -14,6 +14,10 @@ class Ticket

attr_reader :full, :history, :saved

def self.authenticate(user, pass)
connection.authenticate(user, pass)
end

# Creates a new ticket. Attributes queue and subject are required. Expects a hash with the attributes of the ticket.
#
# ticket = MyTicket.new(:queue => "Some Queue", :subject => "The System is Down.")
Expand Down

0 comments on commit a7ff0b1

Please sign in to comment.