class Cb::Clients::CoverLetters
Public Class Methods
create(args={})
click to toggle source
# File lib/cb/clients/cover_letters.rb, line 22 def create(args={}) cb_client.cb_put(Cb.configuration.uri_cover_letters, body: body(args), headers: headers(args)) end
delete(args={})
click to toggle source
# File lib/cb/clients/cover_letters.rb, line 28 def delete(args={}) cb_client.cb_delete(uri_with_id(args), body: body(args), headers: headers(args)) end
get(args={})
click to toggle source
# File lib/cb/clients/cover_letters.rb, line 16 def get(args={}) uri = Cb.configuration.uri_cover_letters uri += "/#{ args[:id] }" if args[:id] cb_client.cb_get(uri, headers: headers(args)) end
update(args={})
click to toggle source
# File lib/cb/clients/cover_letters.rb, line 32 def update(args={}) cb_client.cb_post(uri_with_id(args), body: body(args), headers: headers(args)) end
Private Class Methods
body(args)
click to toggle source
# File lib/cb/clients/cover_letters.rb, line 42 def body(args) body = Hash.new body[:id] = args[:id] if args[:id] body[:text] = args[:text] if args[:text] body[:name] = args[:name] if args[:name] body.to_json end
uri_with_id(args)
click to toggle source
# File lib/cb/clients/cover_letters.rb, line 38 def uri_with_id(args) "#{ Cb.configuration.uri_cover_letters }/#{ args[:id] }" end