Class: FaxFinder::Abort

Inherits:
Request show all
Defined in:
lib/fax_finder/abort.rb

Constant Summary

Constants inherited from Request

Request::CONTENT_TYPE, Request::TIME_FORMAT

Constants included from Constants

Constants::BASE_PATH, Constants::DEFAULT_PORT, Constants::DEFAULT_SSL

Class Method Summary collapse

Class Method Details

.construct_http_request(fax_key, entry_key) ⇒ Object



13
14
15
16
17
18
# File 'lib/fax_finder/abort.rb', line 13

def self.construct_http_request(fax_key, entry_key)
  request = Net::HTTP::Delete.new(self.path(fax_key, entry_key))
  request.basic_auth self.user, self.password
  request.set_content_type(Request::CONTENT_TYPE)
  request
end

.delete(fax_key, entry_key) ⇒ Object



7
8
9
10
11
# File 'lib/fax_finder/abort.rb', line 7

def self.delete(fax_key, entry_key)
  self.post(){
    construct_http_request(fax_key, entry_key)
  }
end

.path(fax_key, entry_key) ⇒ Object



20
21
22
23
# File 'lib/fax_finder/abort.rb', line 20

def self.path(fax_key, entry_key)
  params=[BASE_PATH, fax_key, entry_key].reject{ |p| p.nil? }
  File.join(*params)
end