Module: RubyLokaliseApi::Rest::Orders
- Included in:
- RubyLokaliseApi::Rest
- Defined in:
- lib/ruby_lokalise_api/rest/orders.rb
Instance Method Summary collapse
-
#create_order(team_id, req_params) ⇒ RubyLokaliseApi::Resources::Order
Creates a new order.
-
#order(team_id, order_id) ⇒ RubyLokaliseApi::Resources::Order
Returns a single order.
-
#orders(team_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::Orders
Returns orders for the given team.
Instance Method Details
#create_order(team_id, req_params) ⇒ RubyLokaliseApi::Resources::Order
Creates a new order
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ruby_lokalise_api/rest/orders.rb', line 47 def create_order(team_id, req_params) params = { query: team_id, req: req_params } response = endpoint(name: 'Orders', params: params).do_post # We must patch content because the API does not return team_id and it's mandatory to build resource URL response.patch_content_with 'team_id', team_id resource 'Order', response end |
#order(team_id, order_id) ⇒ RubyLokaliseApi::Resources::Order
Returns a single order
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ruby_lokalise_api/rest/orders.rb', line 30 def order(team_id, order_id) params = { query: [team_id, order_id] } response = endpoint(name: 'Orders', params: params).do_get # We must patch content because the API does not return team_id and it's mandatory to build resource URL response.patch_content_with 'team_id', team_id resource 'Order', response end |
#orders(team_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::Orders
Returns orders for the given team
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ruby_lokalise_api/rest/orders.rb', line 12 def orders(team_id, req_params = {}) name = 'Orders' params = { query: team_id, req: req_params } response = endpoint(name: name, params: params).do_get # We must patch content because the API does not return team_id and it's mandatory to build resource URLs response.patch_content_with 'team_id', team_id collection name, response end |