Module: LeverPostings

Defined in:
lib/lever_postings.rb,
lib/lever_postings/error.rb,
lib/lever_postings/client.rb,
lib/lever_postings/posting.rb,
lib/lever_postings/version.rb

Defined Under Namespace

Classes: Client, Error, Posting

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.apply(account, api_key, params) ⇒ Object



11
12
13
14
15
16
# File 'lib/lever_postings.rb', line 11

def self.apply(, api_key, params)
  postings_api = LeverPostings::Client.new("postings", )
  posting_id = params[:posting_id]
  results = postings_api.post(posting_id, { api_key: api_key }, params)
  results
end

.postings(account, params = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/lever_postings.rb', line 18

def self.postings(, params = {})
  params[:mode] ||= "json"
  postings_api = LeverPostings::Client.new("postings", )
  results = postings_api.get(params.delete(:id), params)

  if params.key?(:mode) && params[:mode] == "html"
    results
  else
    Posting.from_json(results)
  end
end