Module: RubyLokaliseApi::BaseRequest
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
Methods included from Connection
#connection
#custom_dump, #custom_load
Instance Method Details
#delete(path, client, params = {}) ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/ruby_lokalise_api/base_request.rb', line 36
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
8
9
10
11
12
13
|
# File 'lib/ruby_lokalise_api/base_request.rb', line 8
def get(path, client, params = {})
respond_with(
connection(client).get(prepare(path), params),
client
)
end
|
#patch(path, client, params = {}) ⇒ Object
29
30
31
32
33
34
|
# File 'lib/ruby_lokalise_api/base_request.rb', line 29
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
15
16
17
18
19
20
|
# File 'lib/ruby_lokalise_api/base_request.rb', line 15
def post(path, client, params = {})
respond_with(
connection(client).post(prepare(path), custom_dump(params)),
client
)
end
|
#put(path, client, params = {}) ⇒ Object
22
23
24
25
26
27
|
# File 'lib/ruby_lokalise_api/base_request.rb', line 22
def put(path, client, params = {})
respond_with(
connection(client).put(prepare(path), custom_dump(params)),
client
)
end
|