Class: DearInventoryRuby::AttributeSet
- Inherits:
-
Object
- Object
- DearInventoryRuby::AttributeSet
- Defined in:
- lib/dear-inventory-ruby/models/attribute_set.rb
Instance Attribute Summary collapse
-
#attribute10_name ⇒ Object
Name of tenth attribute.
-
#attribute10_type ⇒ Object
Type of tenth attribute.
-
#attribute10_values ⇒ Object
Comma-separated list of values for tenth attribute (applicable when Type is List).
-
#attribute1_name ⇒ Object
Name of first attribute.
-
#attribute1_type ⇒ Object
Type of first attribute.
-
#attribute1_values ⇒ Object
Comma-separated list of values for first attribute (applicable when Type is List).
-
#attribute2_name ⇒ Object
Name of second attribute.
-
#attribute2_type ⇒ Object
Type of second attribute.
-
#attribute2_values ⇒ Object
Comma-separated list of values for second attribute (applicable when Type is List).
-
#attribute3_name ⇒ Object
Name of third attribute.
-
#attribute3_type ⇒ Object
Type of third attribute.
-
#attribute3_values ⇒ Object
Comma-separated list of values for third attribute (applicable when Type is List).
-
#attribute4_name ⇒ Object
Name of fourth attribute.
-
#attribute4_type ⇒ Object
Type of fourth attribute.
-
#attribute4_values ⇒ Object
Comma-separated list of values for fourth attribute (applicable when Type is List).
-
#attribute5_name ⇒ Object
Name of fifth attribute.
-
#attribute5_type ⇒ Object
Type of fifth attribute.
-
#attribute5_values ⇒ Object
Comma-separated list of values for fifth attribute (applicable when Type is List).
-
#attribute6_name ⇒ Object
Name of sixth attribute.
-
#attribute6_type ⇒ Object
Type of sixth attribute.
-
#attribute6_values ⇒ Object
Comma-separated list of values for sixth attribute (applicable when Type is List).
-
#attribute7_name ⇒ Object
Name of seventh attribute.
-
#attribute7_type ⇒ Object
Type of seventh attribute.
-
#attribute7_values ⇒ Object
Comma-separated list of values for seventh attribute (applicable when Type is List).
-
#attribute8_name ⇒ Object
Name of eighth attribute.
-
#attribute8_type ⇒ Object
Type of eighth attribute.
-
#attribute8_values ⇒ Object
Comma-separated list of values for eighth attribute (applicable when Type is List).
-
#attribute9_name ⇒ Object
Name of ninth attribute.
-
#attribute9_type ⇒ Object
Type of ninth attribute.
-
#attribute9_values ⇒ Object
Comma-separated list of values for ninth attribute (applicable when Type is List).
-
#attributes ⇒ Object
Array of Attribute Set Attributes.
-
#id ⇒ Object
Unique Attribute Set identifier.
-
#name ⇒ Object
Name of Attribute Set.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_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 ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AttributeSet
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 = {}) ⇒ AttributeSet
Initializes the object
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 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 202 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `DearInventoryRuby::AttributeSet` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `DearInventoryRuby::AttributeSet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'attribute1_name') self.attribute1_name = attributes[:'attribute1_name'] end if attributes.key?(:'attribute1_type') self.attribute1_type = attributes[:'attribute1_type'] end if attributes.key?(:'attribute1_values') self.attribute1_values = attributes[:'attribute1_values'] end if attributes.key?(:'attribute2_name') self.attribute2_name = attributes[:'attribute2_name'] end if attributes.key?(:'attribute2_type') self.attribute2_type = attributes[:'attribute2_type'] end if attributes.key?(:'attribute2_values') self.attribute2_values = attributes[:'attribute2_values'] end if attributes.key?(:'attribute3_name') self.attribute3_name = attributes[:'attribute3_name'] end if attributes.key?(:'attribute3_type') self.attribute3_type = attributes[:'attribute3_type'] end if attributes.key?(:'attribute3_values') self.attribute3_values = attributes[:'attribute3_values'] end if attributes.key?(:'attribute4_name') self.attribute4_name = attributes[:'attribute4_name'] end if attributes.key?(:'attribute4_type') self.attribute4_type = attributes[:'attribute4_type'] end if attributes.key?(:'attribute4_values') self.attribute4_values = attributes[:'attribute4_values'] end if attributes.key?(:'attribute5_name') self.attribute5_name = attributes[:'attribute5_name'] end if attributes.key?(:'attribute5_type') self.attribute5_type = attributes[:'attribute5_type'] end if attributes.key?(:'attribute5_values') self.attribute5_values = attributes[:'attribute5_values'] end if attributes.key?(:'attribute6_name') self.attribute6_name = attributes[:'attribute6_name'] end if attributes.key?(:'attribute6_type') self.attribute6_type = attributes[:'attribute6_type'] end if attributes.key?(:'attribute6_values') self.attribute6_values = attributes[:'attribute6_values'] end if attributes.key?(:'attribute7_name') self.attribute7_name = attributes[:'attribute7_name'] end if attributes.key?(:'attribute7_type') self.attribute7_type = attributes[:'attribute7_type'] end if attributes.key?(:'attribute7_values') self.attribute7_values = attributes[:'attribute7_values'] end if attributes.key?(:'attribute8_name') self.attribute8_name = attributes[:'attribute8_name'] end if attributes.key?(:'attribute8_type') self.attribute8_type = attributes[:'attribute8_type'] end if attributes.key?(:'attribute8_values') self.attribute8_values = attributes[:'attribute8_values'] end if attributes.key?(:'attribute9_name') self.attribute9_name = attributes[:'attribute9_name'] end if attributes.key?(:'attribute9_type') self.attribute9_type = attributes[:'attribute9_type'] end if attributes.key?(:'attribute9_values') self.attribute9_values = attributes[:'attribute9_values'] end if attributes.key?(:'attribute10_name') self.attribute10_name = attributes[:'attribute10_name'] end if attributes.key?(:'attribute10_type') self.attribute10_type = attributes[:'attribute10_type'] end if attributes.key?(:'attribute10_values') self.attribute10_values = attributes[:'attribute10_values'] end if attributes.key?(:'attributes') if (value = attributes[:'attributes']).is_a?(Array) self.attributes = value end end end |
Instance Attribute Details
#attribute10_name ⇒ Object
Name of tenth attribute
105 106 107 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 105 def attribute10_name @attribute10_name end |
#attribute10_type ⇒ Object
Type of tenth attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
108 109 110 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 108 def attribute10_type @attribute10_type end |
#attribute10_values ⇒ Object
Comma-separated list of values for tenth attribute (applicable when Type is List)
111 112 113 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 111 def attribute10_values @attribute10_values end |
#attribute1_name ⇒ Object
Name of first attribute
24 25 26 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 24 def attribute1_name @attribute1_name end |
#attribute1_type ⇒ Object
Type of first attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
27 28 29 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 27 def attribute1_type @attribute1_type end |
#attribute1_values ⇒ Object
Comma-separated list of values for first attribute (applicable when Type is List)
30 31 32 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 30 def attribute1_values @attribute1_values end |
#attribute2_name ⇒ Object
Name of second attribute
33 34 35 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 33 def attribute2_name @attribute2_name end |
#attribute2_type ⇒ Object
Type of second attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
36 37 38 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 36 def attribute2_type @attribute2_type end |
#attribute2_values ⇒ Object
Comma-separated list of values for second attribute (applicable when Type is List)
39 40 41 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 39 def attribute2_values @attribute2_values end |
#attribute3_name ⇒ Object
Name of third attribute
42 43 44 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 42 def attribute3_name @attribute3_name end |
#attribute3_type ⇒ Object
Type of third attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
45 46 47 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 45 def attribute3_type @attribute3_type end |
#attribute3_values ⇒ Object
Comma-separated list of values for third attribute (applicable when Type is List)
48 49 50 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 48 def attribute3_values @attribute3_values end |
#attribute4_name ⇒ Object
Name of fourth attribute
51 52 53 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 51 def attribute4_name @attribute4_name end |
#attribute4_type ⇒ Object
Type of fourth attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
54 55 56 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 54 def attribute4_type @attribute4_type end |
#attribute4_values ⇒ Object
Comma-separated list of values for fourth attribute (applicable when Type is List)
57 58 59 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 57 def attribute4_values @attribute4_values end |
#attribute5_name ⇒ Object
Name of fifth attribute
60 61 62 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 60 def attribute5_name @attribute5_name end |
#attribute5_type ⇒ Object
Type of fifth attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
63 64 65 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 63 def attribute5_type @attribute5_type end |
#attribute5_values ⇒ Object
Comma-separated list of values for fifth attribute (applicable when Type is List)
66 67 68 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 66 def attribute5_values @attribute5_values end |
#attribute6_name ⇒ Object
Name of sixth attribute
69 70 71 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 69 def attribute6_name @attribute6_name end |
#attribute6_type ⇒ Object
Type of sixth attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
72 73 74 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 72 def attribute6_type @attribute6_type end |
#attribute6_values ⇒ Object
Comma-separated list of values for sixth attribute (applicable when Type is List)
75 76 77 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 75 def attribute6_values @attribute6_values end |
#attribute7_name ⇒ Object
Name of seventh attribute
78 79 80 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 78 def attribute7_name @attribute7_name end |
#attribute7_type ⇒ Object
Type of seventh attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
81 82 83 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 81 def attribute7_type @attribute7_type end |
#attribute7_values ⇒ Object
Comma-separated list of values for seventh attribute (applicable when Type is List)
84 85 86 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 84 def attribute7_values @attribute7_values end |
#attribute8_name ⇒ Object
Name of eighth attribute
87 88 89 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 87 def attribute8_name @attribute8_name end |
#attribute8_type ⇒ Object
Type of eighth attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
90 91 92 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 90 def attribute8_type @attribute8_type end |
#attribute8_values ⇒ Object
Comma-separated list of values for eighth attribute (applicable when Type is List)
93 94 95 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 93 def attribute8_values @attribute8_values end |
#attribute9_name ⇒ Object
Name of ninth attribute
96 97 98 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 96 def attribute9_name @attribute9_name end |
#attribute9_type ⇒ Object
Type of ninth attribute. Should be one of the following values: Text, List, Checkbox, Not used, Date, Numeric
99 100 101 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 99 def attribute9_type @attribute9_type end |
#attribute9_values ⇒ Object
Comma-separated list of values for ninth attribute (applicable when Type is List)
102 103 104 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 102 def attribute9_values @attribute9_values end |
#attributes ⇒ Object
Array of Attribute Set Attributes
114 115 116 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 114 def attributes @attributes end |
#id ⇒ Object
Unique Attribute Set identifier
18 19 20 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 18 def id @id end |
#name ⇒ Object
Name of Attribute Set
21 22 23 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 21 def name @name end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 151 152 153 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 117 def self.attribute_map { :'id' => :'ID', :'name' => :'Name', :'attribute1_name' => :'Attribute1Name', :'attribute1_type' => :'Attribute1Type', :'attribute1_values' => :'Attribute1Values', :'attribute2_name' => :'Attribute2Name', :'attribute2_type' => :'Attribute2Type', :'attribute2_values' => :'Attribute2Values', :'attribute3_name' => :'Attribute3Name', :'attribute3_type' => :'Attribute3Type', :'attribute3_values' => :'Attribute3Values', :'attribute4_name' => :'Attribute4Name', :'attribute4_type' => :'Attribute4Type', :'attribute4_values' => :'Attribute4Values', :'attribute5_name' => :'Attribute5Name', :'attribute5_type' => :'Attribute5Type', :'attribute5_values' => :'Attribute5Values', :'attribute6_name' => :'Attribute6Name', :'attribute6_type' => :'Attribute6Type', :'attribute6_values' => :'Attribute6Values', :'attribute7_name' => :'Attribute7Name', :'attribute7_type' => :'Attribute7Type', :'attribute7_values' => :'Attribute7Values', :'attribute8_name' => :'Attribute8Name', :'attribute8_type' => :'Attribute8Type', :'attribute8_values' => :'Attribute8Values', :'attribute9_name' => :'Attribute9Name', :'attribute9_type' => :'Attribute9Type', :'attribute9_values' => :'Attribute9Values', :'attribute10_name' => :'Attribute10Name', :'attribute10_type' => :'Attribute10Type', :'attribute10_values' => :'Attribute10Values', :'attributes' => :'Attributes' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
423 424 425 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 423 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
195 196 197 198 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 195 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 156 def self.openapi_types { :'id' => :'String', :'name' => :'String', :'attribute1_name' => :'String', :'attribute1_type' => :'String', :'attribute1_values' => :'String', :'attribute2_name' => :'String', :'attribute2_type' => :'String', :'attribute2_values' => :'String', :'attribute3_name' => :'String', :'attribute3_type' => :'String', :'attribute3_values' => :'String', :'attribute4_name' => :'String', :'attribute4_type' => :'String', :'attribute4_values' => :'String', :'attribute5_name' => :'String', :'attribute5_type' => :'String', :'attribute5_values' => :'String', :'attribute6_name' => :'String', :'attribute6_type' => :'String', :'attribute6_values' => :'String', :'attribute7_name' => :'String', :'attribute7_type' => :'String', :'attribute7_values' => :'String', :'attribute8_name' => :'String', :'attribute8_type' => :'String', :'attribute8_values' => :'String', :'attribute9_name' => :'String', :'attribute9_type' => :'String', :'attribute9_values' => :'String', :'attribute10_name' => :'String', :'attribute10_type' => :'String', :'attribute10_values' => :'String', :'attributes' => :'Array<AttributeSetAttribute>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 370 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && attribute1_name == o.attribute1_name && attribute1_type == o.attribute1_type && attribute1_values == o.attribute1_values && attribute2_name == o.attribute2_name && attribute2_type == o.attribute2_type && attribute2_values == o.attribute2_values && attribute3_name == o.attribute3_name && attribute3_type == o.attribute3_type && attribute3_values == o.attribute3_values && attribute4_name == o.attribute4_name && attribute4_type == o.attribute4_type && attribute4_values == o.attribute4_values && attribute5_name == o.attribute5_name && attribute5_type == o.attribute5_type && attribute5_values == o.attribute5_values && attribute6_name == o.attribute6_name && attribute6_type == o.attribute6_type && attribute6_values == o.attribute6_values && attribute7_name == o.attribute7_name && attribute7_type == o.attribute7_type && attribute7_values == o.attribute7_values && attribute8_name == o.attribute8_name && attribute8_type == o.attribute8_type && attribute8_values == o.attribute8_values && attribute9_name == o.attribute9_name && attribute9_type == o.attribute9_type && attribute9_values == o.attribute9_values && attribute10_name == o.attribute10_name && attribute10_type == o.attribute10_type && attribute10_values == o.attribute10_values && attributes == o.attributes end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 451 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 DearInventoryRuby.const_get(type).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
520 521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 520 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
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 430 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that 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
410 411 412 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 410 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
416 417 418 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 416 def hash [id, name, attribute1_name, attribute1_type, attribute1_values, attribute2_name, attribute2_type, attribute2_values, attribute3_name, attribute3_type, attribute3_values, attribute4_name, attribute4_type, attribute4_values, attribute5_name, attribute5_type, attribute5_values, attribute6_name, attribute6_type, attribute6_values, attribute7_name, attribute7_type, attribute7_values, attribute8_name, attribute8_type, attribute8_values, attribute9_name, attribute9_type, attribute9_values, attribute10_name, attribute10_type, attribute10_values, attributes].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
352 353 354 355 356 357 358 359 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 352 def list_invalid_properties invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
496 497 498 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 496 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
502 503 504 505 506 507 508 509 510 511 512 513 514 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 502 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
490 491 492 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 490 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
363 364 365 366 |
# File 'lib/dear-inventory-ruby/models/attribute_set.rb', line 363 def valid? return false if @name.nil? true end |