Module: RubyLokaliseApi::Rest::TranslationProviders

Included in:
RubyLokaliseApi::Rest
Defined in:
lib/ruby_lokalise_api/rest/translation_providers.rb

Instance Method Summary collapse

Instance Method Details

#translation_provider(team_id, provider_id) ⇒ RubyLokaliseApi::Resources::TranslationProvider

Returns a single translation provider

Parameters:

  • team_id (String, Integer)
  • provider_id (String, Integer)

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
# File 'lib/ruby_lokalise_api/rest/translation_providers.rb', line 30

def translation_provider(team_id, provider_id)
  params = { query: [team_id, provider_id] }

  response = endpoint(name: 'TranslationProviders', 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

  resource 'TranslationProvider', response
end

#translation_providers(team_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::TranslationProviders

Returns translation providers

Parameters:

  • team_id (String, Integer)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ruby_lokalise_api/rest/translation_providers.rb', line 12

def translation_providers(team_id, req_params = {})
  name = 'TranslationProviders'
  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