Class: AsposeCellsCloud::Worksheet

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Worksheet

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 192

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'Index')
    self.index = attributes[:'Index']
  end

  if attributes.has_key?(:'Pictures')
    self.pictures = attributes[:'Pictures']
  end

  if attributes.has_key?(:'Charts')
    self.charts = attributes[:'Charts']
  end

  if attributes.has_key?(:'Comments')
    self.comments = attributes[:'Comments']
  end

  if attributes.has_key?(:'Hyperlinks')
    self.hyperlinks = attributes[:'Hyperlinks']
  end

  if attributes.has_key?(:'IsVisible')
    self.is_visible = attributes[:'IsVisible']
  end

  if attributes.has_key?(:'ViewType')
    self.view_type = attributes[:'ViewType']
  end

  if attributes.has_key?(:'Type')
    self.type = attributes[:'Type']
  end

  if attributes.has_key?(:'IsGridlinesVisible')
    self.is_gridlines_visible = attributes[:'IsGridlinesVisible']
  end

  if attributes.has_key?(:'IsRowColumnHeadersVisible')
    self.is_row_column_headers_visible = attributes[:'IsRowColumnHeadersVisible']
  end

  if attributes.has_key?(:'IsPageBreakPreview')
    self.is_page_break_preview = attributes[:'IsPageBreakPreview']
  end

  if attributes.has_key?(:'DisplayZeros')
    self.display_zeros = attributes[:'DisplayZeros']
  end

  if attributes.has_key?(:'TransitionEvaluation')
    self.transition_evaluation = attributes[:'TransitionEvaluation']
  end

  if attributes.has_key?(:'DisplayRightToLeft')
    self.display_right_to_left = attributes[:'DisplayRightToLeft']
  end

  if attributes.has_key?(:'FirstVisibleColumn')
    self.first_visible_column = attributes[:'FirstVisibleColumn']
  end

  if attributes.has_key?(:'OleObjects')
    self.ole_objects = attributes[:'OleObjects']
  end

  if attributes.has_key?(:'IsOutlineShown')
    self.is_outline_shown = attributes[:'IsOutlineShown']
  end

  if attributes.has_key?(:'Name')
    self.name = attributes[:'Name']
  end

  if attributes.has_key?(:'AutoShapes')
    self.auto_shapes = attributes[:'AutoShapes']
  end

  if attributes.has_key?(:'Cells')
    self.cells = attributes[:'Cells']
  end

  if attributes.has_key?(:'Validations')
    self.validations = attributes[:'Validations']
  end

  if attributes.has_key?(:'Zoom')
    self.zoom = attributes[:'Zoom']
  end

  if attributes.has_key?(:'ConditionalFormattings')
    self.conditional_formattings = attributes[:'ConditionalFormattings']
  end

  if attributes.has_key?(:'IsSelected')
    self.is_selected = attributes[:'IsSelected']
  end

  if attributes.has_key?(:'TabColor')
    self.tab_color = attributes[:'TabColor']
  end

  if attributes.has_key?(:'FirstVisibleRow')
    self.first_visible_row = attributes[:'FirstVisibleRow']
  end

  if attributes.has_key?(:'TransitionEntry')
    self.transition_entry = attributes[:'TransitionEntry']
  end

  if attributes.has_key?(:'VisibilityType')
    self.visibility_type = attributes[:'VisibilityType']
  end

  if attributes.has_key?(:'IsRulerVisible')
    self.is_ruler_visible = attributes[:'IsRulerVisible']
  end

  if attributes.has_key?(:'Links')
    if (value = attributes[:'Links']).is_a?(Array)
      self.links = value
    end
  end

  if attributes.has_key?(:'IsProtected')
    self.is_protected = attributes[:'IsProtected']
  end

  if attributes.has_key?(:'MergedCells')
    self.merged_cells = attributes[:'MergedCells']
  end

end

Instance Attribute Details

#auto_shapesObject

Returns the value of attribute auto_shapes.



77
78
79
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 77

def auto_shapes
  @auto_shapes
end

#cellsObject

Returns the value of attribute cells.



79
80
81
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 79

def cells
  @cells
end

#chartsObject

Returns the value of attribute charts.



33
34
35
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 33

def charts
  @charts
end

#commentsObject

Returns the value of attribute comments.



35
36
37
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 35

def comments
  @comments
end

#conditional_formattingsObject

Returns the value of attribute conditional_formattings.



86
87
88
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 86

def conditional_formattings
  @conditional_formattings
end

#display_right_to_leftObject

Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.



64
65
66
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 64

def display_right_to_left
  @display_right_to_left
end

#display_zerosObject

True if zero values are displayed.



58
59
60
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 58

def display_zeros
  @display_zeros
end

#first_visible_columnObject

Represents first visible column index.



67
68
69
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 67

def first_visible_column
  @first_visible_column
end

#first_visible_rowObject

Represents first visible row index.



95
96
97
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 95

def first_visible_row
  @first_visible_row
end

Returns the value of attribute hyperlinks.



37
38
39
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 37

def hyperlinks
  @hyperlinks
end

#indexObject

Gets the index of sheet in the worksheets collection.



29
30
31
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 29

def index
  @index
end

#is_gridlines_visibleObject

Gets or sets a value indicating whether the gridelines are visible.Default is true.



49
50
51
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 49

def is_gridlines_visible
  @is_gridlines_visible
end

#is_outline_shownObject

Indicates whether show outline.



72
73
74
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 72

def is_outline_shown
  @is_outline_shown
end

#is_page_break_previewObject

Indications the specified worksheet is shown in normal view or page break preview.



55
56
57
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 55

def is_page_break_preview
  @is_page_break_preview
end

#is_protectedObject

Indicates if the worksheet is protected.



109
110
111
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 109

def is_protected
  @is_protected
end

#is_row_column_headers_visibleObject

Gets or sets a value indicating whether the worksheet will display row and column headers.Default is true.



52
53
54
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 52

def is_row_column_headers_visible
  @is_row_column_headers_visible
end

#is_ruler_visibleObject

Indicates whether the ruler is visible. Only apply for page break preview.



104
105
106
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 104

def is_ruler_visible
  @is_ruler_visible
end

#is_selectedObject

Indicates whether this worksheet is selected when the workbook is opened.



89
90
91
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 89

def is_selected
  @is_selected
end

#is_visibleObject

Represents if the worksheet is visible.



40
41
42
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 40

def is_visible
  @is_visible
end

Returns the value of attribute links.



106
107
108
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 106

def links
  @links
end

#merged_cellsObject

Returns the value of attribute merged_cells.



111
112
113
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 111

def merged_cells
  @merged_cells
end

#nameObject

Gets or sets the name of the worksheet.



75
76
77
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 75

def name
  @name
end

#ole_objectsObject

Returns the value of attribute ole_objects.



69
70
71
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 69

def ole_objects
  @ole_objects
end

#picturesObject

Returns the value of attribute pictures.



31
32
33
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 31

def pictures
  @pictures
end

#tab_colorObject

Represents worksheet tab color.



92
93
94
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 92

def tab_color
  @tab_color
end

#transition_entryObject

Flag indicating whether the Transition Formula Entry (Lotus compatibility) option is enabled.



98
99
100
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 98

def transition_entry
  @transition_entry
end

#transition_evaluationObject

Flag indicating whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.



61
62
63
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 61

def transition_evaluation
  @transition_evaluation
end

#typeObject

Represents worksheet type



46
47
48
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 46

def type
  @type
end

#validationsObject

Returns the value of attribute validations.



81
82
83
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 81

def validations
  @validations
end

#view_typeObject

Gets and sets the view type.



43
44
45
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 43

def view_type
  @view_type
end

#visibility_typeObject

Indicates the state for this sheet visibility



101
102
103
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 101

def visibility_type
  @visibility_type
end

#zoomObject

Represents the scaling factor in percent. It should be btween 10 and 400.



84
85
86
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 84

def zoom
  @zoom
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 115

def self.attribute_map
  {
    :'index' => :'Index',
    :'pictures' => :'Pictures',
    :'charts' => :'Charts',
    :'comments' => :'Comments',
    :'hyperlinks' => :'Hyperlinks',
    :'is_visible' => :'IsVisible',
    :'view_type' => :'ViewType',
    :'type' => :'Type',
    :'is_gridlines_visible' => :'IsGridlinesVisible',
    :'is_row_column_headers_visible' => :'IsRowColumnHeadersVisible',
    :'is_page_break_preview' => :'IsPageBreakPreview',
    :'display_zeros' => :'DisplayZeros',
    :'transition_evaluation' => :'TransitionEvaluation',
    :'display_right_to_left' => :'DisplayRightToLeft',
    :'first_visible_column' => :'FirstVisibleColumn',
    :'ole_objects' => :'OleObjects',
    :'is_outline_shown' => :'IsOutlineShown',
    :'name' => :'Name',
    :'auto_shapes' => :'AutoShapes',
    :'cells' => :'Cells',
    :'validations' => :'Validations',
    :'zoom' => :'Zoom',
    :'conditional_formattings' => :'ConditionalFormattings',
    :'is_selected' => :'IsSelected',
    :'tab_color' => :'TabColor',
    :'first_visible_row' => :'FirstVisibleRow',
    :'transition_entry' => :'TransitionEntry',
    :'visibility_type' => :'VisibilityType',
    :'is_ruler_visible' => :'IsRulerVisible',
    :'links' => :'Links',
    :'is_protected' => :'IsProtected',
    :'merged_cells' => :'MergedCells'
  }
end

.swagger_typesObject

Attribute type mapping.



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 153

def self.swagger_types
  {
    :'index' => :'Integer',
    :'pictures' => :'LinkElement',
    :'charts' => :'LinkElement',
    :'comments' => :'LinkElement',
    :'hyperlinks' => :'LinkElement',
    :'is_visible' => :'BOOLEAN',
    :'view_type' => :'String',
    :'type' => :'String',
    :'is_gridlines_visible' => :'BOOLEAN',
    :'is_row_column_headers_visible' => :'BOOLEAN',
    :'is_page_break_preview' => :'BOOLEAN',
    :'display_zeros' => :'BOOLEAN',
    :'transition_evaluation' => :'BOOLEAN',
    :'display_right_to_left' => :'BOOLEAN',
    :'first_visible_column' => :'Integer',
    :'ole_objects' => :'LinkElement',
    :'is_outline_shown' => :'BOOLEAN',
    :'name' => :'String',
    :'auto_shapes' => :'LinkElement',
    :'cells' => :'LinkElement',
    :'validations' => :'LinkElement',
    :'zoom' => :'Integer',
    :'conditional_formattings' => :'LinkElement',
    :'is_selected' => :'BOOLEAN',
    :'tab_color' => :'Color',
    :'first_visible_row' => :'Integer',
    :'transition_entry' => :'BOOLEAN',
    :'visibility_type' => :'String',
    :'is_ruler_visible' => :'BOOLEAN',
    :'links' => :'Array<Link>',
    :'is_protected' => :'BOOLEAN',
    :'merged_cells' => :'LinkElement'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 355

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      index == o.index &&
      pictures == o.pictures &&
      charts == o.charts &&
      comments == o.comments &&
      hyperlinks == o.hyperlinks &&
      is_visible == o.is_visible &&
      view_type == o.view_type &&
      type == o.type &&
      is_gridlines_visible == o.is_gridlines_visible &&
      is_row_column_headers_visible == o.is_row_column_headers_visible &&
      is_page_break_preview == o.is_page_break_preview &&
      display_zeros == o.display_zeros &&
      transition_evaluation == o.transition_evaluation &&
      display_right_to_left == o.display_right_to_left &&
      first_visible_column == o.first_visible_column &&
      ole_objects == o.ole_objects &&
      is_outline_shown == o.is_outline_shown &&
      name == o.name &&
      auto_shapes == o.auto_shapes &&
      cells == o.cells &&
      validations == o.validations &&
      zoom == o.zoom &&
      conditional_formattings == o.conditional_formattings &&
      is_selected == o.is_selected &&
      tab_color == o.tab_color &&
      first_visible_row == o.first_visible_row &&
      transition_entry == o.transition_entry &&
      visibility_type == o.visibility_type &&
      is_ruler_visible == o.is_ruler_visible &&
      links == o.links &&
      is_protected == o.is_protected &&
      merged_cells == o.merged_cells
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 428

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = AsposeCellsCloud.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 494

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 407

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


394
395
396
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 394

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



400
401
402
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 400

def hash
  [index, pictures, charts, comments, hyperlinks, is_visible, view_type, type, is_gridlines_visible, is_row_column_headers_visible, is_page_break_preview, display_zeros, transition_evaluation, display_right_to_left, first_visible_column, ole_objects, is_outline_shown, name, auto_shapes, cells, validations, zoom, conditional_formattings, is_selected, tab_color, first_visible_row, transition_entry, visibility_type, is_ruler_visible, links, is_protected, merged_cells].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 332

def list_invalid_properties
  invalid_properties = Array.new
  if @index.nil?
    invalid_properties.push("invalid value for 'index', index cannot be nil.")
  end

  if @is_protected.nil?
    invalid_properties.push("invalid value for 'is_protected', is_protected cannot be nil.")
  end

  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



474
475
476
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 474

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



480
481
482
483
484
485
486
487
488
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 480

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



468
469
470
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 468

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



347
348
349
350
351
# File 'lib/aspose_cells_cloud/models/worksheet.rb', line 347

def valid?
  return false if @index.nil?
  return false if @is_protected.nil?
  return true
end