Class: Mugen::Jobs

Inherits:
Client show all
Defined in:
lib/mugen/jobs.rb

Class Method Summary collapse

Methods inherited from Client

before_get, before_post, before_put, check_for_errors

Class Method Details

.all(options = {}) ⇒ Object

translate/jobs (GET)

Retrieves a list of resources for the most recent jobs filtered by the given parameters.



10
11
12
13
14
# File 'lib/mugen/jobs.rb', line 10

def all(options={})
  res = self.get "/translate/jobs", :query => options 
  check_for_errors(res)
  res['response']
end

.by_group(id, options = {}) ⇒ Object

translate/jobs/id (GET)

Retrieves the group of jobs that were previously submitted together.



23
24
25
26
27
# File 'lib/mugen/jobs.rb', line 23

def by_group(id, options={})
  res = self.get "/translate/jobs/#{id}", :query => options 
  check_for_errors(res)
  res['response']
end

.create(options = {}) ⇒ Object

translate/jobs (POST)

Submits a job or group of jobs to translate.



34
35
36
37
38
# File 'lib/mugen/jobs.rb', line 34

def create(options = {})
  res = self.post "/translate/jobs", :body => options
  check_for_errors(res)
  res['response']
end