Module: RubyLokaliseApi

Defined in:
lib/ruby_lokalise_api.rb,
lib/ruby_lokalise_api/rest.rb,
lib/ruby_lokalise_api/error.rb,
lib/ruby_lokalise_api/client.rb,
lib/ruby_lokalise_api/request.rb,
lib/ruby_lokalise_api/version.rb,
lib/ruby_lokalise_api/generics.rb,
lib/ruby_lokalise_api/response.rb,
lib/ruby_lokalise_api/rest/jwts.rb,
lib/ruby_lokalise_api/rest/keys.rb,
lib/ruby_lokalise_api/connection.rb,
lib/ruby_lokalise_api/rest/files.rb,
lib/ruby_lokalise_api/rest/tasks.rb,
lib/ruby_lokalise_api/rest/teams.rb,
lib/ruby_lokalise_api/utils/keys.rb,
lib/ruby_lokalise_api/base_client.rb,
lib/ruby_lokalise_api/oauth2/auth.rb,
lib/ruby_lokalise_api/rest/orders.rb,
lib/ruby_lokalise_api/json_handler.rb,
lib/ruby_lokalise_api/oauth2_client.rb,
lib/ruby_lokalise_api/resources/jwt.rb,
lib/ruby_lokalise_api/resources/key.rb,
lib/ruby_lokalise_api/rest/branches.rb,
lib/ruby_lokalise_api/rest/comments.rb,
lib/ruby_lokalise_api/rest/projects.rb,
lib/ruby_lokalise_api/rest/segments.rb,
lib/ruby_lokalise_api/rest/webhooks.rb,
lib/ruby_lokalise_api/utils/classes.rb,
lib/ruby_lokalise_api/utils/loaders.rb,
lib/ruby_lokalise_api/utils/strings.rb,
lib/ruby_lokalise_api/resources/base.rb,
lib/ruby_lokalise_api/resources/file.rb,
lib/ruby_lokalise_api/resources/task.rb,
lib/ruby_lokalise_api/resources/team.rb,
lib/ruby_lokalise_api/rest/languages.rb,
lib/ruby_lokalise_api/rest/snapshots.rb,
lib/ruby_lokalise_api/resources/order.rb,
lib/ruby_lokalise_api/rest/team_users.rb,
lib/ruby_lokalise_api/collections/base.rb,
lib/ruby_lokalise_api/collections/keys.rb,
lib/ruby_lokalise_api/resources/branch.rb,
lib/ruby_lokalise_api/rest/screenshots.rb,
lib/ruby_lokalise_api/utils/attributes.rb,
lib/ruby_lokalise_api/collections/files.rb,
lib/ruby_lokalise_api/collections/tasks.rb,
lib/ruby_lokalise_api/collections/teams.rb,
lib/ruby_lokalise_api/resources/comment.rb,
lib/ruby_lokalise_api/resources/project.rb,
lib/ruby_lokalise_api/resources/segment.rb,
lib/ruby_lokalise_api/resources/webhook.rb,
lib/ruby_lokalise_api/rest/contributors.rb,
lib/ruby_lokalise_api/rest/translations.rb,
lib/ruby_lokalise_api/collections/orders.rb,
lib/ruby_lokalise_api/resources/snapshot.rb,
lib/ruby_lokalise_api/rest/payment_cards.rb,
lib/ruby_lokalise_api/resources/team_user.rb,
lib/ruby_lokalise_api/collections/branches.rb,
lib/ruby_lokalise_api/collections/projects.rb,
lib/ruby_lokalise_api/collections/segments.rb,
lib/ruby_lokalise_api/collections/webhooks.rb,
lib/ruby_lokalise_api/resources/screenshot.rb,
lib/ruby_lokalise_api/collections/snapshots.rb,
lib/ruby_lokalise_api/resources/contributor.rb,
lib/ruby_lokalise_api/resources/translation.rb,
lib/ruby_lokalise_api/rest/queued_processes.rb,
lib/ruby_lokalise_api/rest/team_user_groups.rb,
lib/ruby_lokalise_api/collections/team_users.rb,
lib/ruby_lokalise_api/concerns/unsupportable.rb,
lib/ruby_lokalise_api/resources/oauth2_token.rb,
lib/ruby_lokalise_api/resources/payment_card.rb,
lib/ruby_lokalise_api/collections/screenshots.rb,
lib/ruby_lokalise_api/concerns/attrs_loadable.rb,
lib/ruby_lokalise_api/endpoints/base_endpoint.rb,
lib/ruby_lokalise_api/endpoints/jwts_endpoint.rb,
lib/ruby_lokalise_api/endpoints/keys_endpoint.rb,
lib/ruby_lokalise_api/endpoints/main_endpoint.rb,
lib/ruby_lokalise_api/collections/contributors.rb,
lib/ruby_lokalise_api/collections/key_comments.rb,
lib/ruby_lokalise_api/collections/translations.rb,
lib/ruby_lokalise_api/concerns/hash_accessible.rb,
lib/ruby_lokalise_api/endpoints/files_endpoint.rb,
lib/ruby_lokalise_api/endpoints/tasks_endpoint.rb,
lib/ruby_lokalise_api/endpoints/teams_endpoint.rb,
lib/ruby_lokalise_api/resources/queued_process.rb,
lib/ruby_lokalise_api/collections/payment_cards.rb,
lib/ruby_lokalise_api/endpoints/orders_endpoint.rb,
lib/ruby_lokalise_api/resources/system_language.rb,
lib/ruby_lokalise_api/resources/team_user_group.rb,
lib/ruby_lokalise_api/rest/permission_templates.rb,
lib/ruby_lokalise_api/resources/project_language.rb,
lib/ruby_lokalise_api/rest/translation_providers.rb,
lib/ruby_lokalise_api/endpoints/branches_endpoint.rb,
lib/ruby_lokalise_api/endpoints/projects_endpoint.rb,
lib/ruby_lokalise_api/endpoints/segments_endpoint.rb,
lib/ruby_lokalise_api/endpoints/webhooks_endpoint.rb,
lib/ruby_lokalise_api/collections/project_comments.rb,
lib/ruby_lokalise_api/collections/queued_processes.rb,
lib/ruby_lokalise_api/collections/system_languages.rb,
lib/ruby_lokalise_api/collections/team_user_groups.rb,
lib/ruby_lokalise_api/endpoints/snapshots_endpoint.rb,
lib/ruby_lokalise_api/collections/project_languages.rb,
lib/ruby_lokalise_api/endpoints/team_users_endpoint.rb,
lib/ruby_lokalise_api/resources/permission_template.rb,
lib/ruby_lokalise_api/endpoints/screenshots_endpoint.rb,
lib/ruby_lokalise_api/resources/translation_provider.rb,
lib/ruby_lokalise_api/rest/team_user_billing_details.rb,
lib/ruby_lokalise_api/endpoints/contributors_endpoint.rb,
lib/ruby_lokalise_api/endpoints/key_comments_endpoint.rb,
lib/ruby_lokalise_api/endpoints/translations_endpoint.rb,
lib/ruby_lokalise_api/collections/permission_templates.rb,
lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb,
lib/ruby_lokalise_api/endpoints/payment_cards_endpoint.rb,
lib/ruby_lokalise_api/resources/oauth2_refreshed_token.rb,
lib/ruby_lokalise_api/rest/custom_translation_statuses.rb,
lib/ruby_lokalise_api/collections/translation_providers.rb,
lib/ruby_lokalise_api/endpoints/project_comments_endpoint.rb,
lib/ruby_lokalise_api/endpoints/queued_processes_endpoint.rb,
lib/ruby_lokalise_api/endpoints/system_languages_endpoint.rb,
lib/ruby_lokalise_api/endpoints/team_user_groups_endpoint.rb,
lib/ruby_lokalise_api/resources/custom_translation_status.rb,
lib/ruby_lokalise_api/resources/team_user_billing_details.rb,
lib/ruby_lokalise_api/endpoints/project_languages_endpoint.rb,
lib/ruby_lokalise_api/collections/custom_translation_statuses.rb,
lib/ruby_lokalise_api/endpoints/permission_templates_endpoint.rb,
lib/ruby_lokalise_api/endpoints/translation_providers_endpoint.rb,
lib/ruby_lokalise_api/endpoints/team_user_billing_details_endpoint.rb,
lib/ruby_lokalise_api/endpoints/custom_translation_statuses_endpoint.rb

Overview

Official Ruby client for Lokalise APIv2

Defined Under Namespace

Modules: Collections, Concerns, Connection, Endpoints, JsonHandler, OAuth2, Request, Resources, Rest, Utils Classes: BaseClient, Client, Error, Generics, OAuth2Client, Response

Constant Summary collapse

VERSION =
'9.2.1'

Class Method Summary collapse

Class Method Details

.auth_client(client_id, client_secret, params = {}) ⇒ RubyLokaliseApi::OAuth2::Auth

Initializes a new Auth client to request OAuth 2 tokens

Parameters:

  • client_id (String)
  • client_secret (String)
  • params (Hash) (defaults to: {})

Returns:



56
57
58
# File 'lib/ruby_lokalise_api.rb', line 56

def auth_client(client_id, client_secret, params = {})
  RubyLokaliseApi::OAuth2::Auth.new client_id, client_secret, params
end

.client(token, params = {}) ⇒ RubyLokaliseApi::Client

Initializes a new Client object

Parameters:

  • token (String)
  • params (Hash) (defaults to: {})

Returns:



27
28
29
# File 'lib/ruby_lokalise_api.rb', line 27

def client(token, params = {})
  @client = RubyLokaliseApi::Client.new token, params
end

.oauth2_client(token, params = {}) ⇒ RubyLokaliseApi::OAuth2Client

Initializes a new OAuth2Client object

Parameters:

  • token (String)
  • params (Hash) (defaults to: {})

Returns:



41
42
43
# File 'lib/ruby_lokalise_api.rb', line 41

def oauth2_client(token, params = {})
  @oauth2_client = RubyLokaliseApi::OAuth2Client.new token, params
end

.reset_client!Object

Reset the currently set client



32
33
34
# File 'lib/ruby_lokalise_api.rb', line 32

def reset_client!
  @client = nil
end

.reset_oauth2_client!Object

Reset the currently set OAuth2 client



46
47
48
# File 'lib/ruby_lokalise_api.rb', line 46

def reset_oauth2_client!
  @oauth2_client = nil
end