lib/efax.rb in drnic-ruby-efax-1.1.0 vs lib/efax.rb in drnic-ruby-efax-1.1.1
- old
+ new
@@ -40,13 +40,13 @@
end
end
module EFax
# URL of eFax web service
- URL = "https://secure.efaxdeveloper.com/EFax_WebFax.serv"
+ Url = "https://secure.efaxdeveloper.com/EFax_WebFax.serv"
# URI of eFax web service
- URI = URI.parse(URL)
+ Uri = URI.parse(Url)
# Prefered content type
HEADERS = {'Content-Type' => 'text/xml'}
# Base class for OutboundRequest and OutboundStatus classes
class Request
@@ -80,12 +80,12 @@
end
class OutboundRequest < Request
def self.post(name, company, fax_number, subject, content, content_type = :html)
xml_request = xml(name, company, fax_number, subject, content, content_type)
- response = Net::HTTPS.start(EFax::URI.host, EFax::URI.port) do |https|
- https.post(EFax::URI.path, params(xml_request), EFax::HEADERS)
+ response = Net::HTTPS.start(EFax::Uri.host, EFax::Uri.port) do |https|
+ https.post(EFax::Uri.path, params(xml_request), EFax::HEADERS)
end
OutboundResponse.new(response)
end
def self.xml(name, company, fax_number, subject, content, content_type = :html)
@@ -159,11 +159,11 @@
end
class OutboundStatus < Request
def self.post(doc_id)
data = params(xml(doc_id))
- response = Net::HTTPS.start(EFax::URI.host, EFax::URI.port) do |https|
- https.post(EFax::URI.path, data, EFax::HEADERS)
+ response = Net::HTTPS.start(EFax::Uri.host, EFax::Uri.port) do |https|
+ https.post(EFax::Uri.path, data, EFax::HEADERS)
end
OutboundStatusResponse.new(response)
end
def self.xml(doc_id)