drnic-ruby-efax 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/efax.rb +6 -6
- data/ruby-efax.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/lib/efax.rb
CHANGED
@@ -80,15 +80,15 @@ module EFax
|
|
80
80
|
end
|
81
81
|
|
82
82
|
class OutboundRequest < Request
|
83
|
-
def self.post(name, company, fax_number, subject,
|
84
|
-
xml_request = xml(name, company, fax_number, subject,
|
83
|
+
def self.post(name, company, fax_number, subject, content, content_type = :html)
|
84
|
+
xml_request = xml(name, company, fax_number, subject, content, content_type)
|
85
85
|
response = Net::HTTPS.start(EFax::URI.host, EFax::URI.port) do |https|
|
86
86
|
https.post(EFax::URI.path, params(xml_request), EFax::HEADERS)
|
87
87
|
end
|
88
88
|
OutboundResponse.new(response)
|
89
89
|
end
|
90
90
|
|
91
|
-
def self.xml(name, company, fax_number, subject,
|
91
|
+
def self.xml(name, company, fax_number, subject, content, content_type = :html)
|
92
92
|
xml_request = ""
|
93
93
|
xml = Builder::XmlMarkup.new(:target => xml_request, :indent => 2 )
|
94
94
|
xml.instruct! :xml, :version => '1.0'
|
@@ -116,9 +116,9 @@ module EFax
|
|
116
116
|
end
|
117
117
|
xml.Files do
|
118
118
|
xml.File do
|
119
|
-
|
120
|
-
xml.FileContents(
|
121
|
-
xml.FileType(
|
119
|
+
encoded_content = Base64.encode64(content).delete("\n")
|
120
|
+
xml.FileContents(encoded_content)
|
121
|
+
xml.FileType(content_type.to_s)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
data/ruby-efax.gemspec
CHANGED