mygengo 1.0 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mygengo-ruby/api_handler.rb +26 -1
- data/lib/mygengo.rb +1 -1
- metadata +2 -2
@@ -182,6 +182,15 @@ module MyGengo
|
|
182
182
|
self.send_to_mygengo('translate/job/:id'.gsub(':id', params.delete(:id)), params)
|
183
183
|
end
|
184
184
|
|
185
|
+
# Updates a group of already submitted jobs.
|
186
|
+
#
|
187
|
+
# Options:
|
188
|
+
# <tt>jobs</tt> - An Array of job objects to update (job objects or ids)
|
189
|
+
# <tt>action</tt> - A String describing the update to this job. "approved", "rejected", etc - see myGengo docs.
|
190
|
+
def updateTranslationJobs(params = {})
|
191
|
+
self.send_to_mygengo('translate/jobs', {:jobs => params[:jobs], :action => params[:action]})
|
192
|
+
end
|
193
|
+
|
185
194
|
# Given an ID, pulls down information concerning that job from myGengo.
|
186
195
|
#
|
187
196
|
# <tt>id</tt> - The ID of a job to check.
|
@@ -196,6 +205,10 @@ module MyGengo
|
|
196
205
|
# <tt>timestamp_after</tt> - Optional. Epoch timestamp from which to filter submitted jobs.
|
197
206
|
# <tt>count</tt> - Optional. Defaults to 10.
|
198
207
|
def getTranslationJobs(params = {})
|
208
|
+
if params[:ids] and params[:ids].kind_of?(Array)
|
209
|
+
params[:ids] = params[:ids].map { |i| i.to_s() }.join(',')
|
210
|
+
end
|
211
|
+
|
199
212
|
self.get_from_mygengo('translate/jobs', params)
|
200
213
|
end
|
201
214
|
|
@@ -203,7 +216,7 @@ module MyGengo
|
|
203
216
|
#
|
204
217
|
# <tt>id</tt> - Required, the ID of a job that you want the batch/group of.
|
205
218
|
def getTranslationJobBatch(params = {})
|
206
|
-
self.get_from_mygengo('translate/jobs/:
|
219
|
+
self.get_from_mygengo('translate/jobs/group/:group_id'.gsub(':group_id', params.delete(:group_id)), params)
|
207
220
|
end
|
208
221
|
|
209
222
|
# Mirrors the bulk Translation call, but just returns an estimated cost.
|
@@ -269,6 +282,18 @@ module MyGengo
|
|
269
282
|
self.send_to_mygengo('translate/job/:id'.gsub(':id', params.delete(:id)), params)
|
270
283
|
end
|
271
284
|
|
285
|
+
# Deletes multiple jobs.
|
286
|
+
#
|
287
|
+
# Options:
|
288
|
+
# <tt>ids</tt> - An Array of job IDs you want to delete.
|
289
|
+
def deleteTranslationJobs(params = {})
|
290
|
+
if params[:ids] and params[:ids].kind_of?(Array)
|
291
|
+
params[:ids] = params[:ids].map { |i| i.to_s() }.join(',')
|
292
|
+
end
|
293
|
+
|
294
|
+
self.send_to_mygengo('translate/jobs', params)
|
295
|
+
end
|
296
|
+
|
272
297
|
# Gets information about currently supported language pairs.
|
273
298
|
#
|
274
299
|
# Options:
|
data/lib/mygengo.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: mygengo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: "1.
|
5
|
+
version: "1.2"
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan McGrath <ryan@mygengo.com>
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2011-08-17 00:00:00
|
15
|
+
date: 2011-08-17 00:00:00 +09:00
|
16
16
|
default_executable:
|
17
17
|
dependencies: []
|
18
18
|
|