Module: RubyLokaliseApi

Defined in:
lib/ruby_lokalise_api/utils/string_utils.rb,
lib/ruby_lokalise_api.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/rest/jwt.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/base_client.rb,
lib/ruby_lokalise_api/oauth2/auth.rb,
lib/ruby_lokalise_api/rest/orders.rb,
lib/ruby_lokalise_api/base_request.rb,
lib/ruby_lokalise_api/json_handler.rb,
lib/ruby_lokalise_api/oauth2/token.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/oauth2/refresh.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/collections/key.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/file.rb,
lib/ruby_lokalise_api/collections/task.rb,
lib/ruby_lokalise_api/collections/team.rb,
lib/ruby_lokalise_api/resources/branch.rb,
lib/ruby_lokalise_api/rest/screenshots.rb,
lib/ruby_lokalise_api/collections/order.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/branch.rb,
lib/ruby_lokalise_api/resources/snapshot.rb,
lib/ruby_lokalise_api/rest/payment_cards.rb,
lib/ruby_lokalise_api/collections/project.rb,
lib/ruby_lokalise_api/collections/segment.rb,
lib/ruby_lokalise_api/collections/webhook.rb,
lib/ruby_lokalise_api/resources/team_user.rb,
lib/ruby_lokalise_api/collections/snapshot.rb,
lib/ruby_lokalise_api/resources/screenshot.rb,
lib/ruby_lokalise_api/collections/team_user.rb,
lib/ruby_lokalise_api/resources/contributor.rb,
lib/ruby_lokalise_api/resources/key_comment.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/screenshot.rb,
lib/ruby_lokalise_api/resources/payment_card.rb,
lib/ruby_lokalise_api/utils/endpoint_helpers.rb,
lib/ruby_lokalise_api/collections/contributor.rb,
lib/ruby_lokalise_api/collections/key_comment.rb,
lib/ruby_lokalise_api/collections/translation.rb,
lib/ruby_lokalise_api/utils/attribute_helpers.rb,
lib/ruby_lokalise_api/collections/payment_card.rb,
lib/ruby_lokalise_api/resources/queued_process.rb,
lib/ruby_lokalise_api/resources/project_comment.rb,
lib/ruby_lokalise_api/resources/system_language.rb,
lib/ruby_lokalise_api/resources/team_user_group.rb,
lib/ruby_lokalise_api/collections/queued_process.rb,
lib/ruby_lokalise_api/resources/project_language.rb,
lib/ruby_lokalise_api/rest/translation_providers.rb,
lib/ruby_lokalise_api/collections/project_comment.rb,
lib/ruby_lokalise_api/collections/system_language.rb,
lib/ruby_lokalise_api/collections/team_user_group.rb,
lib/ruby_lokalise_api/collections/project_language.rb,
lib/ruby_lokalise_api/resources/translation_provider.rb,
lib/ruby_lokalise_api/rest/team_user_billing_details.rb,
lib/ruby_lokalise_api/collections/translation_provider.rb,
lib/ruby_lokalise_api/rest/custom_translation_statuses.rb,
lib/ruby_lokalise_api/resources/custom_translation_status.rb,
lib/ruby_lokalise_api/resources/team_user_billing_details.rb,
lib/ruby_lokalise_api/collections/custom_translation_status.rb

Overview

Initial code taken from Facets gem by Rubyworks github.com/rubyworks/facets/blob/master/lib/core/facets/string/snakecase.rb

Defined Under Namespace

Modules: BaseRequest, Collections, Connection, JsonHandler, OAuth2, Request, Resources, Rest, Utils Classes: BaseClient, Client, Error, OAuth2Client

Constant Summary collapse

VERSION =
'7.2.0'

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:



52
53
54
# File 'lib/ruby_lokalise_api.rb', line 52

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:



23
24
25
# File 'lib/ruby_lokalise_api.rb', line 23

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:



37
38
39
# File 'lib/ruby_lokalise_api.rb', line 37

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

.reset_client!Object

Reset the currently set client



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

def reset_client!
  @client = nil
end

.reset_oauth2_client!Object

Reset the currently set OAuth2 client



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

def reset_oauth2_client!
  @oauth2_client = nil
end