Module: Lokalise::Request
Constant Summary
collapse
%w[x-pagination-total-count x-pagination-page-count x-pagination-limit x-pagination-page].freeze
Constants included
from Connection
Connection::BASE_URL
Instance Method Summary
collapse
-
#delete(path, client, params = {}) ⇒ Object
-
#get(path, client, params = {}) ⇒ Object
-
#patch(path, client, params = {}) ⇒ Object
-
#post(path, client, params = {}) ⇒ Object
-
#put(path, client, params = {}) ⇒ Object
#custom_dump, #custom_load
Methods included from Connection
#connection
Instance Method Details
#delete(path, client, params = {}) ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/ruby-lokalise-api/request.rb', line 39
def delete(path, client, params = {})
respond_with(
connection(client).delete(prepare(path)) do |req|
req.body = custom_dump params
end,
client
)
end
|
#get(path, client, params = {}) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/ruby-lokalise-api/request.rb', line 11
def get(path, client, params = {})
respond_with(
connection(client).get(prepare(path), params),
client
)
end
|
#patch(path, client, params = {}) ⇒ Object
32
33
34
35
36
37
|
# File 'lib/ruby-lokalise-api/request.rb', line 32
def patch(path, client, params = {})
respond_with(
connection(client).patch(prepare(path), params.any? ? custom_dump(params) : nil),
client
)
end
|
#post(path, client, params = {}) ⇒ Object
18
19
20
21
22
23
|
# File 'lib/ruby-lokalise-api/request.rb', line 18
def post(path, client, params = {})
respond_with(
connection(client).post(prepare(path), custom_dump(params)),
client
)
end
|
#put(path, client, params = {}) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/ruby-lokalise-api/request.rb', line 25
def put(path, client, params = {})
respond_with(
connection(client).put(prepare(path), custom_dump(params)),
client
)
end
|