Class: Tracker::Jira::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/tracker/jira/host.rb

Constant Summary collapse

JIRA_API =
"jira1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, username, password) ⇒ Host

Returns a new instance of Host.



10
11
12
# File 'lib/tracker/jira/host.rb', line 10

def initialize(uri, username, password)
  @uri, @username, @password = uri, username, password
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



8
9
10
# File 'lib/tracker/jira/host.rb', line 8

def uri
  @uri
end

Instance Method Details

#loginObject



18
19
20
21
22
# File 'lib/tracker/jira/host.rb', line 18

def 
  client = XMLRPC::Client.new2("#{uri}/rpc/xmlrpc")
  token = client.call("#{JIRA_API}.login", @username, @password)
  Session.new(client, token)
end

#project(identifier) ⇒ Object



14
15
16
# File 'lib/tracker/jira/host.rb', line 14

def project(identifier)
  Project.new(self, identifier)
end