Sha256: ed78bf6c3aa89b8077d3c9934c39f8ef4a6b5592ab2d10731aa11eea97669ac1
Contents?: true
Size: 1.04 KB
Versions: 8
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true module Crowdin class Configuration attr_accessor :api_token attr_accessor :project_id attr_accessor :organization_domain attr_accessor :enable_logger alias logger_enabled? enable_logger attr_reader :target_api_url def initialize @target_api_url = '/api/v2' end def options { headers: {}, timeout: nil, json: true } end def headers { 'Accept' => 'application/json', 'Authorization' => "Bearer #{api_token}", 'Content-Type' => 'application/json', 'User-Agent' => "crowdin-rb/#{Crowdin::Client::VERSION}/#{RUBY_VERSION}/#{RUBY_PLATFORM}" } end def base_url @base_url ||= if !!organization_domain if organization_domain.include?('.com') "https://#{organization_domain}" else "https://#{organization_domain}.api.crowdin.com" end else 'https://api.crowdin.com' end end end end
Version data entries
8 entries across 8 versions & 1 rubygems