Class: ClickUp::ConnectionManager
- Inherits:
-
Object
- Object
- ClickUp::ConnectionManager
- Defined in:
- lib/click_up/connection_manager.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(path, data) ⇒ ConnectionManager
constructor
A new instance of ConnectionManager.
- #post ⇒ Object
Constructor Details
#initialize(path, data) ⇒ ConnectionManager
Returns a new instance of ConnectionManager.
7 8 9 10 |
# File 'lib/click_up/connection_manager.rb', line 7 def initialize(path, data) @path = path @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/click_up/connection_manager.rb', line 5 def data @data end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/click_up/connection_manager.rb', line 5 def path @path end |
Instance Method Details
#delete ⇒ Object
23 24 25 26 |
# File 'lib/click_up/connection_manager.rb', line 23 def delete net_http_response = https_client.delete(resource_url.path, default_headers) format_response(net_http_response.body) end |
#get ⇒ Object
12 13 14 15 |
# File 'lib/click_up/connection_manager.rb', line 12 def get net_http_response = https_client.request_get(resource_url.path, default_headers) format_response(net_http_response.body) end |
#post ⇒ Object
17 18 19 20 21 |
# File 'lib/click_up/connection_manager.rb', line 17 def post form_data = data.to_json if data.is_a?(Hash) && data.size > 0 net_http_response = https_client.request_post(resource_url.path, form_data, default_headers) format_response(net_http_response.body) end |