Class: AsposeCellsCloud::Validation
- Inherits:
-
Object
- Object
- AsposeCellsCloud::Validation
- Defined in:
- lib/aspose_cells_cloud/models/validation.rb
Instance Attribute Summary collapse
-
#alert_style ⇒ Object
Represents the validation alert style.Information,Stop,Warning.
-
#area_list ⇒ Object
Represents a collection of Aspose.Cells.CellArea which contains the data validation settings.
-
#error_message ⇒ Object
Represents the data validation error message.
-
#error_title ⇒ Object
Represents the title of the data-validation error dialog box.
-
#formula1 ⇒ Object
Represents the value or expression associated with the data validation.
-
#formula2 ⇒ Object
Represents the value or expression associated with the second part of the data validation.
-
#ignore_blank ⇒ Object
Indicates whether blank values are permitted by the range data validation.
-
#in_cell_drop_down ⇒ Object
Indicates whether data validation displays a drop-down list that contains acceptable values.
-
#input_message ⇒ Object
Represents the data validation input message.
-
#input_title ⇒ Object
Represents the title of the data-validation input dialog box.
-
#link ⇒ Object
Returns the value of attribute link.
-
#operator ⇒ Object
Represents the operator for the data validation.
-
#show_error ⇒ Object
Indicates whether the data validation error message will be displayed whenever the user enters invalid data.
-
#show_input ⇒ Object
Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.
-
#type ⇒ Object
Represents the data validation type.
-
#value1 ⇒ Object
Represents the first value associated with the data validation.
-
#value2 ⇒ Object
Represents the first value associated with the data validation.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Validation
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Validation
Initializes the object
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 127 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?(:'link') self.link = attributes[:'link'] end if attributes.has_key?(:'Formula2') self.formula2 = attributes[:'Formula2'] end if attributes.has_key?(:'Formula1') self.formula1 = attributes[:'Formula1'] end if attributes.has_key?(:'ShowError') self.show_error = attributes[:'ShowError'] end if attributes.has_key?(:'ErrorMessage') self. = attributes[:'ErrorMessage'] end if attributes.has_key?(:'InCellDropDown') self.in_cell_drop_down = attributes[:'InCellDropDown'] end if attributes.has_key?(:'ShowInput') self.show_input = attributes[:'ShowInput'] end if attributes.has_key?(:'AlertStyle') self.alert_style = attributes[:'AlertStyle'] end if attributes.has_key?(:'InputTitle') self.input_title = attributes[:'InputTitle'] end if attributes.has_key?(:'IgnoreBlank') self.ignore_blank = attributes[:'IgnoreBlank'] end if attributes.has_key?(:'Value2') self.value2 = attributes[:'Value2'] end if attributes.has_key?(:'Value1') self.value1 = attributes[:'Value1'] end if attributes.has_key?(:'Operator') self.operator = attributes[:'Operator'] end if attributes.has_key?(:'ErrorTitle') self.error_title = attributes[:'ErrorTitle'] end if attributes.has_key?(:'Type') self.type = attributes[:'Type'] end if attributes.has_key?(:'InputMessage') self. = attributes[:'InputMessage'] end if attributes.has_key?(:'AreaList') if (value = attributes[:'AreaList']).is_a?(Array) self.area_list = value end end end |
Instance Attribute Details
#alert_style ⇒ Object
Represents the validation alert style.Information,Stop,Warning
49 50 51 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 49 def alert_style @alert_style end |
#area_list ⇒ Object
Represents a collection of Aspose.Cells.CellArea which contains the data validation settings.
76 77 78 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 76 def area_list @area_list end |
#error_message ⇒ Object
Represents the data validation error message.
40 41 42 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 40 def @error_message end |
#error_title ⇒ Object
Represents the title of the data-validation error dialog box.
67 68 69 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 67 def error_title @error_title end |
#formula1 ⇒ Object
Represents the value or expression associated with the data validation.
34 35 36 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 34 def formula1 @formula1 end |
#formula2 ⇒ Object
Represents the value or expression associated with the second part of the data validation.
31 32 33 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 31 def formula2 @formula2 end |
#ignore_blank ⇒ Object
Indicates whether blank values are permitted by the range data validation.
55 56 57 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 55 def ignore_blank @ignore_blank end |
#in_cell_drop_down ⇒ Object
Indicates whether data validation displays a drop-down list that contains acceptable values.
43 44 45 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 43 def in_cell_drop_down @in_cell_drop_down end |
#input_message ⇒ Object
Represents the data validation input message.
73 74 75 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 73 def @input_message end |
#input_title ⇒ Object
Represents the title of the data-validation input dialog box.
52 53 54 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 52 def input_title @input_title end |
#link ⇒ Object
Returns the value of attribute link.
28 29 30 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 28 def link @link end |
#operator ⇒ Object
Represents the operator for the data validation. Between,Equal,GreaterThan,GreaterOrEqual,LessThan,LessOrEqual,None,NotBetween,NotEqual
64 65 66 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 64 def operator @operator end |
#show_error ⇒ Object
Indicates whether the data validation error message will be displayed whenever the user enters invalid data.
37 38 39 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 37 def show_error @show_error end |
#show_input ⇒ Object
Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.
46 47 48 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 46 def show_input @show_input end |
#type ⇒ Object
Represents the data validation type. AnyValue ,WholeNumber,Decimal,List,Date,Time,TextLength,Custom
70 71 72 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 70 def type @type end |
#value1 ⇒ Object
Represents the first value associated with the data validation.
61 62 63 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 61 def value1 @value1 end |
#value2 ⇒ Object
Represents the first value associated with the data validation.
58 59 60 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 58 def value2 @value2 end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 80 def self.attribute_map { :'link' => :'link', :'formula2' => :'Formula2', :'formula1' => :'Formula1', :'show_error' => :'ShowError', :'error_message' => :'ErrorMessage', :'in_cell_drop_down' => :'InCellDropDown', :'show_input' => :'ShowInput', :'alert_style' => :'AlertStyle', :'input_title' => :'InputTitle', :'ignore_blank' => :'IgnoreBlank', :'value2' => :'Value2', :'value1' => :'Value1', :'operator' => :'Operator', :'error_title' => :'ErrorTitle', :'type' => :'Type', :'input_message' => :'InputMessage', :'area_list' => :'AreaList' } end |
.swagger_types ⇒ Object
Attribute type mapping.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 103 def self.swagger_types { :'link' => :'Link', :'formula2' => :'String', :'formula1' => :'String', :'show_error' => :'BOOLEAN', :'error_message' => :'String', :'in_cell_drop_down' => :'BOOLEAN', :'show_input' => :'BOOLEAN', :'alert_style' => :'String', :'input_title' => :'String', :'ignore_blank' => :'BOOLEAN', :'value2' => :'String', :'value1' => :'String', :'operator' => :'String', :'error_title' => :'String', :'type' => :'String', :'input_message' => :'String', :'area_list' => :'Array<CellArea>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 220 def ==(o) return true if self.equal?(o) self.class == o.class && link == o.link && formula2 == o.formula2 && formula1 == o.formula1 && show_error == o.show_error && == o. && in_cell_drop_down == o.in_cell_drop_down && show_input == o.show_input && alert_style == o.alert_style && input_title == o.input_title && ignore_blank == o.ignore_blank && value2 == o.value2 && value1 == o.value1 && operator == o.operator && error_title == o.error_title && type == o.type && == o. && area_list == o.area_list end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 278 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
344 345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 344 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
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 257 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
244 245 246 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 244 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
250 251 252 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 250 def hash [link, formula2, formula1, show_error, , in_cell_drop_down, show_input, alert_style, input_title, ignore_blank, value2, value1, operator, error_title, type, , area_list].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
207 208 209 210 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 207 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
324 325 326 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 324 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
330 331 332 333 334 335 336 337 338 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 330 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_s ⇒ String
Returns the string representation of the object
318 319 320 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 318 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
214 215 216 |
# File 'lib/aspose_cells_cloud/models/validation.rb', line 214 def valid? return true end |