Module: RubyLokaliseApi::Rest::Translations
- Included in:
- RubyLokaliseApi::Rest
- Defined in:
- lib/ruby_lokalise_api/rest/translations.rb
Instance Method Summary collapse
-
#translation(project_id, translation_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Translation
Returns a single translation.
-
#translations(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::Translations
Returns translations.
-
#update_translation(project_id, translation_id, req_params) ⇒ RubyLokaliseApi::Resources::Translation
Updates a translation.
Instance Method Details
#translation(project_id, translation_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::Translation
Returns a single translation
28 29 30 31 32 33 34 |
# File 'lib/ruby_lokalise_api/rest/translations.rb', line 28 def translation(project_id, translation_id, req_params = {}) params = { query: [project_id, translation_id], req: req_params } data = endpoint(name: 'Translations', params: params).do_get resource 'Translation', data end |
#translations(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::Translations
Returns translations
12 13 14 15 16 17 18 19 |
# File 'lib/ruby_lokalise_api/rest/translations.rb', line 12 def translations(project_id, req_params = {}) name = 'Translations' params = { query: project_id, req: req_params } data = endpoint(name: name, params: params).do_get collection name, data end |
#update_translation(project_id, translation_id, req_params) ⇒ RubyLokaliseApi::Resources::Translation
Updates a translation
43 44 45 46 47 48 49 |
# File 'lib/ruby_lokalise_api/rest/translations.rb', line 43 def update_translation(project_id, translation_id, req_params) params = { query: [project_id, translation_id], req: req_params } data = endpoint(name: 'Translations', params: params).do_put resource 'Translation', data end |