Module: RubyLokaliseApi::Rest::GlossaryTerms
- Included in:
- RubyLokaliseApi::Rest
- Defined in:
- lib/ruby_lokalise_api/rest/glossary_terms.rb
Instance Method Summary collapse
-
#create_glossary_terms(project_id, req_params) ⇒ RubyLokaliseApi::Collections::GlossaryTerms
Creates one or multiple glossary terms in the project.
-
#destroy_glossary_terms(project_id, term_ids) ⇒ RubyLokaliseApi::Generics::DeletedResource
Deletes one or multiple glossary terms from the project.
-
#glossary_term(project_id, term_id) ⇒ RubyLokaliseApi::Resources::GlossaryTerm
Returns a single glossary term.
-
#glossary_terms(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::GlossaryTerms
Returns glossary terms.
-
#update_glossary_terms(project_id, req_params) ⇒ RubyLokaliseApi::Collections::GlossaryTerms
Updates one or multiple glossary terms in the project.
Instance Method Details
#create_glossary_terms(project_id, req_params) ⇒ RubyLokaliseApi::Collections::GlossaryTerms
Creates one or multiple glossary terms in the project
43 44 45 46 47 48 49 50 |
# File 'lib/ruby_lokalise_api/rest/glossary_terms.rb', line 43 def create_glossary_terms(project_id, req_params) name = 'GlossaryTerms' params = { query: project_id, req: req_params.to_array_obj(:terms) } data = endpoint(name: name, params: params).do_post collection name, data end |
#destroy_glossary_terms(project_id, term_ids) ⇒ RubyLokaliseApi::Generics::DeletedResource
Deletes one or multiple glossary terms from the project
73 74 75 76 77 78 79 |
# File 'lib/ruby_lokalise_api/rest/glossary_terms.rb', line 73 def destroy_glossary_terms(project_id, term_ids) params = { query: project_id, req: term_ids.to_array_obj(:terms) } data = endpoint(name: 'GlossaryTerms', params: params).do_delete RubyLokaliseApi::Generics::DeletedResource.new data.content end |
#glossary_term(project_id, term_id) ⇒ RubyLokaliseApi::Resources::GlossaryTerm
Returns a single glossary term
14 15 16 17 18 19 20 |
# File 'lib/ruby_lokalise_api/rest/glossary_terms.rb', line 14 def glossary_term(project_id, term_id) params = { query: [project_id, term_id] } data = endpoint(name: 'GlossaryTerms', params: params).do_get resource 'GlossaryTerm', data end |
#glossary_terms(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::GlossaryTerms
Returns glossary terms
28 29 30 31 32 33 34 35 |
# File 'lib/ruby_lokalise_api/rest/glossary_terms.rb', line 28 def glossary_terms(project_id, req_params = {}) name = 'GlossaryTerms' params = { query: project_id, req: req_params } data = endpoint(name: name, params: params).do_get collection name, data end |
#update_glossary_terms(project_id, req_params) ⇒ RubyLokaliseApi::Collections::GlossaryTerms
Updates one or multiple glossary terms in the project
58 59 60 61 62 63 64 65 |
# File 'lib/ruby_lokalise_api/rest/glossary_terms.rb', line 58 def update_glossary_terms(project_id, req_params) name = 'GlossaryTerms' params = { query: project_id, req: req_params.to_array_obj(:terms) } data = endpoint(name: name, params: params).do_put collection name, data end |