Class: Callback::API::Jobs

Inherits:
Base
  • Object
show all
Defined in:
lib/callback/api/jobs.rb

Instance Attribute Summary

Attributes inherited from Base

#access_token, #base_path

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Parser

#parse

Constructor Details

This class inherits a constructor from Callback::API::Base

Instance Method Details

#create(parameters = {}) ⇒ Object



4
5
6
# File 'lib/callback/api/jobs.rb', line 4

def create(parameters={})
  parse request(:post, "/jobs", parameters)
end

#find(id_or_callback_url) ⇒ Object



8
9
10
11
12
13
# File 'lib/callback/api/jobs.rb', line 8

def find(id_or_callback_url)
  # TODO: This needs to be fixed on the server. It cannot parse periods

  safe_id = CGI.escape(id_or_callback_url).gsub "\.", "%2E"
  parse request(:get, "/jobs/#{safe_id}")
end