Class: InterFAX::Outbound::Delivery
- Inherits:
-
Object
- Object
- InterFAX::Outbound::Delivery
- Defined in:
- lib/interfax/outbound/delivery.rb
Constant Summary collapse
- VALID_KEYS =
[:faxNumber, :contact, :postponeTime, :retriesToPerform, :csid, :pageHeader, :reference, :replyAddress, :pageSize, :fitToPage, :pageOrientation, :resolution, :rendering]
- BOUNDARY =
"43e578690a6d14bf1d776cd55e7d7e29"
- HEADERS =
{ "Content-Type" => "multipart/mixed; boundary=#{BOUNDARY}" }.freeze
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#fax_number ⇒ Object
Returns the value of attribute fax_number.
-
#files ⇒ Object
Returns the value of attribute files.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #deliver(params) ⇒ Object
-
#initialize(client) ⇒ Delivery
constructor
A new instance of Delivery.
Constructor Details
#initialize(client) ⇒ Delivery
Returns a new instance of Delivery.
10 11 12 |
# File 'lib/interfax/outbound/delivery.rb', line 10 def initialize client self.client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
2 3 4 |
# File 'lib/interfax/outbound/delivery.rb', line 2 def client @client end |
#fax_number ⇒ Object
Returns the value of attribute fax_number.
2 3 4 |
# File 'lib/interfax/outbound/delivery.rb', line 2 def fax_number @fax_number end |
#files ⇒ Object
Returns the value of attribute files.
2 3 4 |
# File 'lib/interfax/outbound/delivery.rb', line 2 def files @files end |
#params ⇒ Object
Returns the value of attribute params.
2 3 4 |
# File 'lib/interfax/outbound/delivery.rb', line 2 def params @params end |
Instance Method Details
#deliver(params) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/interfax/outbound/delivery.rb', line 14 def deliver params params, files = validate_params(params) file_objects = generate_file_objects(files) body = body_for(file_objects) result = client.post('/outbound/faxes', params, VALID_KEYS, HEADERS, body) InterFAX::Outbound::Fax.new(client: client, id: result.split('/').last) end |