Class: Clicksign::Base
- Inherits:
-
Object
- Object
- Clicksign::Base
- Defined in:
- lib/clicksign/base.rb
Class Method Summary collapse
- .accept_header ⇒ Object
- .api_url(*path) ⇒ Object
- .parse(response) ⇒ Object
- .request(method, *params) ⇒ Object
Class Method Details
.accept_header ⇒ Object
3 4 5 |
# File 'lib/clicksign/base.rb', line 3 def self.accept_header { accept: 'json' } end |
.api_url(*path) ⇒ Object
12 13 14 15 |
# File 'lib/clicksign/base.rb', line 12 def self.api_url(*path) ([Clicksign.endpoint, Clicksign.api_version] + path).join("/") + "?access_token=#{Clicksign.token}" end |
.parse(response) ⇒ Object
17 18 19 20 |
# File 'lib/clicksign/base.rb', line 17 def self.parse(response) response = {} if response.empty? JSON[response] end |
.request(method, *params) ⇒ Object
7 8 9 10 |
# File 'lib/clicksign/base.rb', line 7 def self.request(method, *params) params.last.merge! accept_header parse RestClient.public_send(method, *params) end |