mygengo 1.0 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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/:id'.gsub(':id', params.delete(:id)), params)
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:
@@ -11,6 +11,6 @@ module MyGengo
11
11
  SANDBOX_API_HOST = 'api.sandbox.mygengo.com'
12
12
 
13
13
  # Pretty self explanatory.
14
- VERSION = '1.1'
14
+ VERSION = '1.2'
15
15
  end
16
16
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mygengo
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: "1.0"
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 -04:00
15
+ date: 2011-08-17 00:00:00 +09:00
16
16
  default_executable:
17
17
  dependencies: []
18
18