Class: Docuseal::Http
- Inherits:
-
Object
- Object
- Docuseal::Http
- Defined in:
- lib/docuseal/http.rb
Constant Summary collapse
- USER_AGENT =
"DocuSeal Ruby v#{VERSION}"- BODY_METHODS =
%i[post put].freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #delete(path, params = {}) ⇒ Object
- #get(path, params = {}) ⇒ Object
-
#initialize(config) ⇒ Http
constructor
A new instance of Http.
- #post(path, body = {}) ⇒ Object
- #put(path, body = {}) ⇒ Object
Constructor Details
#initialize(config) ⇒ Http
Returns a new instance of Http.
16 17 18 |
# File 'lib/docuseal/http.rb', line 16 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
14 15 16 |
# File 'lib/docuseal/http.rb', line 14 def config @config end |
Instance Method Details
#delete(path, params = {}) ⇒ Object
32 33 34 |
# File 'lib/docuseal/http.rb', line 32 def delete(path, params = {}) send_request(:delete, path, params) end |
#get(path, params = {}) ⇒ Object
20 21 22 |
# File 'lib/docuseal/http.rb', line 20 def get(path, params = {}) send_request(:get, path, params) end |
#post(path, body = {}) ⇒ Object
24 25 26 |
# File 'lib/docuseal/http.rb', line 24 def post(path, body = {}) send_request(:post, path, {}, body) end |
#put(path, body = {}) ⇒ Object
28 29 30 |
# File 'lib/docuseal/http.rb', line 28 def put(path, body = {}) send_request(:put, path, {}, body) end |