Class: PortaText::Command::Api::Jobs
- Defined in:
- lib/portatext/command/api/jobs.rb
Overview
The jobs endpoint. github.com/PortaText/docs/wiki/REST-API#api_jobs
- Author
-
Marcelo Gornstein ([email protected])
- Copyright
-
Copyright © 2015 PortaText
- License
-
Apache-2.0
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#accept_content_type, #body, #content_type, #delete, #get, #initialize, #patch, #post, #put, #set
Constructor Details
This class inherits a constructor from PortaText::Command::Base
Instance Method Details
#endpoint(_method) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/portatext/command/api/jobs.rb', line 23 def endpoint(_method) page = @args[:page] @args.delete :page endpoint = 'jobs' endpoint = "jobs?page=#{page}" unless page.nil? return endpoint if @args[:id].nil? id = @args[:id] @args.delete :id return "jobs/#{id}/result" unless @args[:accept_any_file].nil? "jobs/#{id}" end |
#id(id) ⇒ Object
11 12 13 |
# File 'lib/portatext/command/api/jobs.rb', line 11 def id(id) set :id, id end |
#page(page) ⇒ Object
15 16 17 |
# File 'lib/portatext/command/api/jobs.rb', line 15 def page(page) set :page, page end |
#save_to(file) ⇒ Object
19 20 21 |
# File 'lib/portatext/command/api/jobs.rb', line 19 def save_to(file) set :accept_any_file, file end |