Class: Cells::Convertor
- Inherits:
-
Object
- Object
- Cells::Convertor
- Defined in:
- lib/saaspose_cells.rb
Overview
This class provides functionality for converting Excel Spreadsheets to other supported formats.
Instance Method Summary collapse
- #convert(localFile, saveFormat) ⇒ Object
-
#initialize(name) ⇒ Convertor
constructor
Constructor for the Convertor Class.
Constructor Details
#initialize(name) ⇒ Convertor
Constructor for the Convertor Class.
-
:name represents the name of the Excel Spreadsheet on the Saaspose server
9 10 11 12 |
# File 'lib/saaspose_cells.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_cells.rb', line 17 def convert(localFile,saveFormat) urlDoc = $productURI + '/cells/' + @name + '?format=' + saveFormat signedURL = Common::Utils.sign(urlDoc) response = RestClient.get(signedURL, :accept => 'application/json') Common::Utils.saveFile(response,localFile) end |