Sha256: ce42bf4cb4bbd5cd3b38ff23edaa7cce53d80d03cac37e07443174e69f88f9f6

Contents?: true

Size: 928 Bytes

Versions: 5

Compression:

Stored size: 928 Bytes

Contents

# frozen_string_literal: true

require 'json'
require 'smartling/auth'
require 'smartling/files'
require 'smartling/contexts'
require 'smartling/strings'
require 'smartling/jobs'
require 'smartling/verbs'
require 'hipsterhash'
require 'forwardable'

module Smartling
  # A fairly generic Smartling REST API client.
  class Client
    include HTTMultiParty
    include Auth
    include Files
    include Strings
    include Jobs
    include Contexts
    include Verbs

    attr_accessor :project_id

    base_uri  'https://api.smartling.com'
    headers   'Accept' => 'application/json'
    raise_on  [404, 401, 500]

    def initialize(user_id:     ENV.fetch('SMARTLING_USER_ID'),
                   user_secret: ENV.fetch('SMARTLING_USER_SECRET'),
                   project_id:  ENV.fetch('SMARTLING_PROJECT_ID', nil))
      @user_id = user_id
      @user_secret = user_secret
      @project_id = project_id
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
smartring-0.0.7 lib/smartling/client.rb
smartring-0.0.6 lib/smartling/client.rb
smartring-0.0.5 lib/smartling/client.rb
smartring-0.0.4 lib/smartling/client.rb
smartring-0.0.3 lib/smartling/client.rb