Class: Aspose::Cloud::Cells::Worksheet

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

Instance Method Summary collapse

Constructor Details

#initialize(filename, worksheet_name) ⇒ Worksheet

Returns a new instance of Worksheet.



22
23
24
25
26
27
28
# File 'lib/Cells/worksheet.rb', line 22

def initialize(filename, worksheet_name)
  @filename = filename
  @worksheet_name = worksheet_name
  raise 'filename not specified.' if filename.empty?
  raise 'worksheet_name not specified.' if worksheet_name.empty?
  @base_uri = "#{Aspose::Cloud::Common::Product.product_uri}/cells/#{@filename}/worksheets/#{@worksheet_name}"
end

Instance Method Details

#add_picture(picture_path, upper_left_row, upper_left_column, lower_right_row, lower_right_column, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/Cells/worksheet.rb', line 357

def add_picture(picture_path, upper_left_row, upper_left_column, lower_right_row, lower_right_column, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'picture_file not specified.' if picture_path.empty?
  raise 'upper_left_row not specified.' if upper_left_row.empty?
  raise 'upper_left_column not specified.' if upper_left_column.empty?
  raise 'lower_right_row not specified.' if lower_right_row.empty?
  raise 'lower_right_column not specified.' if lower_right_column.empty?

  qry = { :upperLeftRow => upper_left_row, :upperLeftColumn => upper_left_column, :lowerRightRow => lower_right_row,
  :lowerRightColumn => lower_right_column, :picturePath => picture_path}
  str_uri = "#{@base_uri}/pictures"
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.put(signed_str_uri, '', { :accept=>'application/json'}))['Code'] == 200 ? true : false
end

#calculate_formula(formula, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



335
336
337
338
339
340
341
342
# File 'lib/Cells/worksheet.rb', line 335

def calculate_formula(formula, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'formula not specified.' if formula.empty?

  str_uri = "#{@base_uri}/formulaResult?formula=#{formula}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Value']
end

#delete_row(index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



293
294
295
296
297
298
299
300
# File 'lib/Cells/worksheet.rb', line 293

def delete_row(index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'index not specified.' if index.nil?

  str_uri = "#{@base_uri}/cells/rows/#{index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))['Code'] == 200 ? true : false
end

#get_auto_shapes_by_index(shape_index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



109
110
111
112
113
114
115
116
# File 'lib/Cells/worksheet.rb', line 109

def get_auto_shapes_by_index(shape_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/autoshapes/#{shape_index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['AutoShapes']
end

#get_auto_shapes_count(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



102
103
104
105
106
107
# File 'lib/Cells/worksheet.rb', line 102

def get_auto_shapes_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/autoshapes"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['AutoShapes']['AuotShapeList'].length
end

#get_cell(cell_name, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



118
119
120
121
122
123
124
125
# File 'lib/Cells/worksheet.rb', line 118

def get_cell(cell_name, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'cell_name not specified.' if cell_name.empty?

  str_uri = "#{@base_uri}/cells/#{cell_name}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cell']
end

#get_cell_style(cell_name, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



127
128
129
130
131
132
133
134
# File 'lib/Cells/worksheet.rb', line 127

def get_cell_style(cell_name, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'cell_name not specified.' if cell_name.empty?

  str_uri = "#{@base_uri}/cells/#{cell_name}/style"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Style']
end

#get_cells_count(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
# File 'lib/Cells/worksheet.rb', line 90

def get_cells_count(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'offset not specified.' if offset.nil?
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/cells"
  qry = { :offset => offset, :count => count}
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cells']['CellCount']
end

#get_cells_list(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/Cells/worksheet.rb', line 30

def get_cells_list(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'offset not specified.' if offset.nil?
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/cells"
  qry = { :offset => offset, :count => count}
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cells']['CellList']
end

#get_chart_by_index(chart_index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



146
147
148
149
150
151
152
153
# File 'lib/Cells/worksheet.rb', line 146

def get_chart_by_index(chart_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'chart_index not specified.' if chart_index.nil?

  str_uri = "#{@base_uri}/charts/#{chart_index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Chart']
end

#get_charts_count(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



237
238
239
240
241
242
# File 'lib/Cells/worksheet.rb', line 237

def get_charts_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/oleobjects"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Charts']['ChartList'].length
end

#get_column(index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



315
316
317
318
319
320
321
322
# File 'lib/Cells/worksheet.rb', line 315

def get_column(index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'index not specified.' if index.nil?

  str_uri = "#{@base_uri}/cells/columns/#{index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Column']
end

#get_columns_list(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/Cells/worksheet.rb', line 54

def get_columns_list(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'offset not specified.' if offset.nil?
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/cells/columns"
  qry = { :offset => offset, :count => count}
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Columns']['ColumnsList']
end

#get_comment(cell_name, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



164
165
166
167
168
169
170
171
# File 'lib/Cells/worksheet.rb', line 164

def get_comment(cell_name, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'cell_name not specified.' if cell_name.empty?

  str_uri = "#{@base_uri}/comments/#{cell_name}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Comment']
end

#get_comments_count(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



244
245
246
247
248
249
# File 'lib/Cells/worksheet.rb', line 244

def get_comments_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/comments"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Comments']['CommentList'].length
end


155
156
157
158
159
160
161
162
# File 'lib/Cells/worksheet.rb', line 155

def get_hyperlink_by_index(link_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'link_index not specified.' if link_index.nil?

  str_uri = "#{@base_uri}/hyperlinks/#{link_index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Hyperlink']
end


251
252
253
254
255
256
# File 'lib/Cells/worksheet.rb', line 251

def get_hyperlinks_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/hyperlinks"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Hyperlinks']['HyperlinkList'].length
end

#get_max_columns(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/Cells/worksheet.rb', line 66

def get_max_columns(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'offset not specified.' if offset.nil?
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/cells"
  qry = { :offset => offset, :count => count}
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cells']['MaxColumn']
end

#get_max_row(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/Cells/worksheet.rb', line 78

def get_max_row(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'offset not specified.' if offset.nil?
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/cells"
  qry = { :offset => offset, :count => count}
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cells']['MaxRow']
end

#get_mergedcell_by_index(index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



200
201
202
203
204
205
206
207
# File 'lib/Cells/worksheet.rb', line 200

def get_mergedcell_by_index(index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'index not specified.' if index.nil?

  str_uri = "#{@base_uri}/mergedCells/#{index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['MergedCell']
end

#get_mergedcells_count(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



209
210
211
212
213
214
# File 'lib/Cells/worksheet.rb', line 209

def get_mergedcells_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/mergedCells"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['MergedCell']['Count']
end

#get_oleobject_by_index(ole_index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



173
174
175
176
177
178
179
180
# File 'lib/Cells/worksheet.rb', line 173

def get_oleobject_by_index(ole_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'ole_index not specified.' if ole_index.nil?

  str_uri = "#{@base_uri}/oleobjects/#{ole_index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['OleObject']
end

#get_oleobjects_count(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



230
231
232
233
234
235
# File 'lib/Cells/worksheet.rb', line 230

def get_oleobjects_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/oleobjects"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['OleObjects']['OleOjectList'].length
end

#get_picture_by_index(image_index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



182
183
184
185
186
187
188
189
# File 'lib/Cells/worksheet.rb', line 182

def get_picture_by_index(image_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'image_index not specified.' if image_index.nil?

  str_uri = "#{@base_uri}/pictures/#{image_index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Picture']
end

#get_pictures_count(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



223
224
225
226
227
228
# File 'lib/Cells/worksheet.rb', line 223

def get_pictures_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/pictures"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Pictures']['PictureList'].length
end

#get_row(index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



284
285
286
287
288
289
290
291
# File 'lib/Cells/worksheet.rb', line 284

def get_row(index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'index not specified.' if index.nil?

  str_uri = "#{@base_uri}/cells/rows/#{index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Row']
end

#get_row_list(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/Cells/worksheet.rb', line 42

def get_row_list(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'offset not specified.' if offset.nil?
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/cells/rows"
  qry = { :offset => offset, :count => count}
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Rows']['RowsList']
end

#get_rows_count(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



272
273
274
275
276
277
278
279
280
281
282
# File 'lib/Cells/worksheet.rb', line 272

def get_rows_count(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'offset not specified.' if offset.nil?
  raise 'count not specified.' if count.nil?

  str_uri = "#{@base_uri}/cells/rows"
  qry = { :offset => offset, :count => count}
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Rows']['RowsCount']
end

#get_validation_by_index(index, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



191
192
193
194
195
196
197
198
# File 'lib/Cells/worksheet.rb', line 191

def get_validation_by_index(index, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'index not specified.' if index.nil?

  str_uri = "#{@base_uri}/validations/#{index}"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Validation']
end

#get_validations_count(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



216
217
218
219
220
221
# File 'lib/Cells/worksheet.rb', line 216

def get_validations_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/validations"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Validations']['Count']
end

#hide_worksheet(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



258
259
260
261
262
263
# File 'lib/Cells/worksheet.rb', line 258

def hide_worksheet(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/visible?isVisible=false"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.put(signed_str_uri, '', {:accept=>'application/json'}))['Code'] == 200 ? true : false
end

#move_worksheet(position, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



325
326
327
328
329
330
331
332
333
# File 'lib/Cells/worksheet.rb', line 325

def move_worksheet(position, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'position not specified.' if position.nil?

  json_data = { :DestinationWorksheet => @worksheet_name, :Position => position }
  str_uri = "#{@base_uri}/position"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.post(signed_str_uri, json_data, { :content_type => :json, :accept=>'application/json'}))['Code'] == 200 ? true : false
end

#set_cell_style(cell_name, style, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



136
137
138
139
140
141
142
143
144
# File 'lib/Cells/worksheet.rb', line 136

def set_cell_style(cell_name, style, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'cell_name not specified.' if cell_name.empty?
  raise 'style not specified.' if style.empty?

  str_uri = "#{@base_uri}/cells/#{cell_name}/style"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.post(signed_str_uri, style.to_json, { :content_type => :json, :accept=>'application/json'}))['Code'] == 200 ? true : false
end

#set_cell_value(cell_name, value_type, value, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/Cells/worksheet.rb', line 344

def set_cell_value(cell_name, value_type, value, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'cell_name not specified.' if cell_name.empty?
  raise 'value_type not specified.' if value_type.empty?
  raise 'value not specified.' if value.empty?

  str_uri = "#{@base_uri}/cells/#{cell_name}"
  qry = { :value => value, :type => value_type }
  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.post(signed_str_uri, '', { :accept=>'application/json'}))['Code'] == 200 ? true : false
end

#sort_data(data_sort, cell_area, folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/Cells/worksheet.rb', line 302

def sort_data(data_sort, cell_area, folder_name = '', storage_type = 'Aspose', storage_name = '')
  raise 'data_sort not specified.' if data_sort.nil?
  raise 'cell_area not specified.' if cell_area.nil?

  str_uri = "#{@base_uri}/sort"
  qry = { :CellArea => cell_area }

  str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.post(signed_str_uri, data_sort.to_json, { :content_type => :json, :accept=>'application/json'}))['Code'] == 200 ? true : false
end

#unhide_worksheet(folder_name = '', storage_type = 'Aspose', storage_name = '') ⇒ Object



265
266
267
268
269
270
# File 'lib/Cells/worksheet.rb', line 265

def unhide_worksheet(folder_name = '', storage_type = 'Aspose', storage_name = '')
  str_uri = "#{@base_uri}/visible?isVisible=true"
  str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
  signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
  JSON.parse(RestClient.put(signed_str_uri, '', {:accept=>'application/json'}))['Code'] == 200 ? true : false
end