Module: RubyLokaliseApi::Rest::Segments
- Included in:
- RubyLokaliseApi::Rest
- Defined in:
- lib/ruby_lokalise_api/rest/segments.rb
Instance Method Summary collapse
-
#segment(project_id, key_id, language_iso, segment_number, req_params = {}) ⇒ RubyLokaliseApi::Resources::Segment
Returns a single project segment.
-
#segments(project_id, key_id, language_iso, req_params = {}) ⇒ RubyLokaliseApi::Collections::Segments
Returns project segments.
-
#update_segment(project_id, key_id, language_iso, segment_number, req_params = {}) ⇒ RubyLokaliseApi::Resources::Segment
Updates a segment.
Instance Method Details
#segment(project_id, key_id, language_iso, segment_number, req_params = {}) ⇒ RubyLokaliseApi::Resources::Segment
Returns a single project segment
32 33 34 35 36 37 38 |
# File 'lib/ruby_lokalise_api/rest/segments.rb', line 32 def segment(project_id, key_id, language_iso, segment_number, req_params = {}) params = { query: [project_id, key_id, language_iso, segment_number], req: req_params } data = endpoint(name: 'Segments', params: params).do_get resource 'Segment', data end |
#segments(project_id, key_id, language_iso, req_params = {}) ⇒ RubyLokaliseApi::Collections::Segments
Returns project segments
14 15 16 17 18 19 20 21 |
# File 'lib/ruby_lokalise_api/rest/segments.rb', line 14 def segments(project_id, key_id, language_iso, req_params = {}) name = 'Segments' params = { query: [project_id, key_id, language_iso], req: req_params } data = endpoint(name: name, params: params).do_get collection name, data end |
#update_segment(project_id, key_id, language_iso, segment_number, req_params = {}) ⇒ RubyLokaliseApi::Resources::Segment
Updates a segment
49 50 51 52 53 54 55 |
# File 'lib/ruby_lokalise_api/rest/segments.rb', line 49 def update_segment(project_id, key_id, language_iso, segment_number, req_params = {}) params = { query: [project_id, key_id, language_iso, segment_number], req: req_params } data = endpoint(name: 'Segments', params: params).do_put resource 'Segment', data end |