Class: Credentials
- Inherits:
-
Object
- Object
- Credentials
- Defined in:
- lib/jirarest2/credentials.rb
Overview
A Credentials object contains the data required to connect to a JIRA(tm) instance.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#baseurl ⇒ Object
readonly
basepath for the REST methods.
-
#connecturl ⇒ Object
url to connect to the JIRA(tm) instance.
-
#username ⇒ Object
username to use.
Instance Method Summary collapse
-
#get_auth_header(request) ⇒ Object
Get the auth header to send to the server.
-
#initialize(url, username) ⇒ Credentials
constructor
A new instance of Credentials.
Constructor Details
#initialize(url, username) ⇒ Credentials
Returns a new instance of Credentials.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/jirarest2/credentials.rb', line 34 def initialize(url,username) uri = URI(url) if uri.instance_of?(URI::HTTP) || uri.instance_of?(URI::HTTPS) then @connecturl = url @username = username @baseurl = @connecturl.gsub(/rest\/api\/.+/,"rest/") else raise Jirarest2::NotAnURLError end end |
Instance Attribute Details
#baseurl ⇒ Object (readonly)
basepath for the REST methods
29 30 31 |
# File 'lib/jirarest2/credentials.rb', line 29 def baseurl @baseurl end |
#connecturl ⇒ Object
url to connect to the JIRA(tm) instance
25 26 27 |
# File 'lib/jirarest2/credentials.rb', line 25 def connecturl @connecturl end |
#username ⇒ Object
username to use
27 28 29 |
# File 'lib/jirarest2/credentials.rb', line 27 def username @username end |
Instance Method Details
#get_auth_header(request) ⇒ Object
Get the auth header to send to the server
59 60 61 |
# File 'lib/jirarest2/credentials.rb', line 59 def get_auth_header(request) end |