Class: Jiralicious::Session
- Inherits:
-
Object
- Object
- Jiralicious::Session
- Includes:
- HTTParty
- Defined in:
- lib/jiralicious/session.rb
Overview
The Session class handles the interactions with the Jira Rest API Through the HTTParty gem.
Direct Known Subclasses
Instance Method Summary collapse
-
#request(method, *options) ⇒ Object
Main access method to request data from the Jira API.
Instance Method Details
#request(method, *options) ⇒ Object
Main access method to request data from the Jira API
- Arguments
-
:method (required) http method type
:options (required) request specific options
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/jiralicious/session.rb', line 25 def request(method, *) if .last.is_a?(Hash) && .last[:handler] response_handler = .last.delete(:handler) else response_handler = handler end self.class.base_uri Jiralicious.uri before_request if respond_to?(:before_request) response = self.class.send(method, *) after_request(response) if respond_to?(:after_request) response_handler.call(response) end |