Class: Crowdin::Client

Constant Summary collapse

VERSION =
'1.1.0'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Errors::ApiErrorsRaiser

#raise_api_token_is_required_error, #raise_only_for_enterprise_mode_error, #raise_organization_domain_is_required_error, #raise_parameter_is_required_error, #raise_project_id_is_required_error

Methods included from ApiResources::SourceStrings

#add_string, #delete_string, #edit_string, #get_string, #list_strings

Methods included from ApiResources::Workflows

#get_workflow_step, #get_workflow_template, #list_workflow_steps, #list_workflow_templates

Methods included from ApiResources::Translations

#apply_pre_translation, #build_project_directory_translation, #build_project_file_translation, #build_project_translation, #cancel_build, #check_project_build_status, #download_project_translations, #export_project_translation, #list_project_builds, #pre_translation_status, #upload_translations

Methods included from ApiResources::TranslationStatus

#get_branch_progress, #get_directory_progress, #get_file_progress, #get_language_progress, #get_project_progress, #get_qa_progress

Methods included from ApiResources::Storages

#add_storage, #delete_storage, #get_storage, #list_storages

Methods included from ApiResources::SourceFiles

#add_branch, #add_directory, #add_file, #delete_branch, #delete_directory, #delete_file, #download_file, #edit_branch, #edit_directory, #edit_file, #get_branch, #get_directory, #get_file, #get_file_revision, #list_branches, #list_directories, #list_file_revisions, #list_files, #update_or_restore_file

Methods included from ApiResources::Projects

#add_group, #add_project, #delete_group, #delete_project, #edit_group, #edit_project, #get_group, #get_project, #list_groups, #list_projects

Methods included from ApiResources::Languages

#add_custom_language, #delete_custom_language, #edit_custom_language, #get_language, #list_languages

Constructor Details

#initialize(&block) ⇒ Client

Returns a new instance of Client.



41
42
43
44
45
46
47
48
# File 'lib/crowdin-api/client/client.rb', line 41

def initialize(&block)
  build_configuration(&block)

  check_logger
  check_rest_client_proxy

  build_connection
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



37
38
39
# File 'lib/crowdin-api/client/client.rb', line 37

def config
  @config
end

#connectionObject (readonly)

Returns the value of attribute connection.



38
39
40
# File 'lib/crowdin-api/client/client.rb', line 38

def connection
  @connection
end

#loggerObject

Returns the value of attribute logger.



35
36
37
# File 'lib/crowdin-api/client/client.rb', line 35

def logger
  @logger
end

#optionsObject (readonly)

Returns the value of attribute options.



39
40
41
# File 'lib/crowdin-api/client/client.rb', line 39

def options
  @options
end

Instance Method Details

#log!(message) ⇒ Object



50
51
52
# File 'lib/crowdin-api/client/client.rb', line 50

def log!(message)
  !config.logger_enabled? || logger.debug(message)
end