Sha256: d6d4dc6c49ac5854d681956387bdbc463de4382154a631627faa8ead640f6831
Contents?: true
Size: 1.03 KB
Versions: 94
Compression:
Stored size: 1.03 KB
Contents
module Translator module Smartling module API class CreateJob include Base def initialize(project_id:, locales:, due_date:, token:) @project_id = project_id @locales = locales @due_date = due_date @token = token end def request_body { 'jobName' => "ADP Translation Job: #{@locales.join(',')} - #{Time.current.to_date}", 'targetLocaleIds' => @locales, 'dueDate' => @due_date, } end def success? @response.code == '200' end def return_value @return_value ||= response_body['response']['data']['translationJobUid'] end def uri @uri ||= URI("https://api.smartling.com/jobs-api/v3/projects/#{@project_id}/jobs") end def headers { 'Content-Type' => 'application/json', 'Authorization' => "Bearer #{@token}" } end def to_s return_value end end end end end
Version data entries
94 entries across 94 versions & 1 rubygems