Class: Words::Convertor

Inherits:
Object
  • Object
show all
Defined in:
lib/saaspose_words.rb

Overview

This class provides functionality for converting Word Documents to other supported formats.

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Convertor

Constructor for the Convertor Class.

  • :name represents the name of the Word Document on the Saaspose server



9
10
11
12
# File 'lib/saaspose_words.rb', line 9

def initialize(name)  
     # Instance variables   
     @name = name
end

Instance Method Details

#convert(localFile, saveFormat) ⇒ Object



17
18
19
20
21
22
# File 'lib/saaspose_words.rb', line 17

def convert(localFile,saveFormat)
		    urlDoc = $productURI + '/words/' + @name + '?format=' + saveFormat
		    signedURL = Common::Utils.sign(urlDoc)
		    response = RestClient.get(signedURL, :accept => 'application/json')
			Common::Utils.saveFile(response,localFile)
end