Class: JiraGateway
- Inherits:
-
Object
- Object
- JiraGateway
- Defined in:
- lib/lita/handlers/jira_gateway.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#http ⇒ Object
readonly
Returns the value of attribute http.
Instance Method Summary collapse
- #data_for_issue(key) ⇒ Object
-
#initialize(http, config) ⇒ JiraGateway
constructor
A new instance of JiraGateway.
Constructor Details
#initialize(http, config) ⇒ JiraGateway
Returns a new instance of JiraGateway.
5 6 7 8 |
# File 'lib/lita/handlers/jira_gateway.rb', line 5 def initialize(http, config) @http = http @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/lita/handlers/jira_gateway.rb', line 3 def config @config end |
#http ⇒ Object (readonly)
Returns the value of attribute http.
3 4 5 |
# File 'lib/lita/handlers/jira_gateway.rb', line 3 def http @http end |
Instance Method Details
#data_for_issue(key) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/lita/handlers/jira_gateway.rb', line 10 def data_for_issue(key) http.basic_auth(config.username, config.password) response = http.get(config.url + '/rest/api/2/issue/' + key) return MultiJson.load(response.body, symbolize_keys: true) if response.success? {} end |