Class: Propertyware::Unit
- Inherits:
-
Object
- Object
- Propertyware::Unit
- Defined in:
- lib/propertyware/models/unit.rb
Overview
Unit
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#abbreviation ⇒ Object
Property abbreviation.
-
#active ⇒ Object
Indicates if the property is active or inactive.
-
#address ⇒ Object
Returns the value of attribute address.
-
#amenities ⇒ Object
Property amenities list.
-
#area_units ⇒ Object
Property total area units.
-
#building_id ⇒ Object
Id of the building associated with this unit.
-
#category ⇒ Object
Property category.
-
#county ⇒ Object
Property region of a state.
-
#created_by ⇒ Object
User who created the record.
-
#created_date_time ⇒ Object
Date and time the record was created.
-
#custom_fields ⇒ Object
Custom fields.
-
#floor_number ⇒ Object
Floor number.
-
#id ⇒ Object
Unique identifier.
-
#id_number ⇒ Object
Unique identifier for Global Search.
-
#last_modified_by ⇒ Object
User who last modified the record.
-
#last_modified_date_time ⇒ Object
Date and time the record was last modified.
-
#lease_id ⇒ Object
Related lease ID.
-
#maintenance_notice ⇒ Object
Property maintenance description.
-
#maintenance_spending_limit_time ⇒ Object
Property maintenance spending limit.
-
#management ⇒ Object
Returns the value of attribute management.
-
#marketing ⇒ Object
Returns the value of attribute marketing.
-
#name ⇒ Object
Name of the property.
-
#neighborhood ⇒ Object
Property neighborhood.
-
#number_floors ⇒ Object
Number floors.
-
#number_of_bathrooms ⇒ Object
Number of bathrooms in the property.
-
#number_of_bedrooms ⇒ Object
Number of bedrooms in the property.
-
#portfolio_id ⇒ Object
ID of the portfolio associated with this property.
-
#property_manager_list ⇒ Object
Property manager details.
-
#ready ⇒ Object
Indicates if the property is ready to lease.
-
#rentable ⇒ Object
Indicates if the property is available for rent.
-
#search_tag ⇒ Object
Property search tag.
-
#status ⇒ Object
Property status (occupied/vacant).
-
#syndicate ⇒ Object
Property syndicate.
-
#target_deposit ⇒ Object
Target deposit.
-
#target_rent ⇒ Object
Property target rent.
-
#target_rent_units ⇒ Object
Property target rent units.
-
#total_area ⇒ Object
Property total area.
-
#type ⇒ Object
Property type.
-
#website ⇒ Object
Property website URL.
-
#year_built ⇒ Object
Property built year.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.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 = {}) ⇒ Unit
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 = {}) ⇒ Unit
Initializes the object
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 349 350 351 352 353 354 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 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 |
# File 'lib/propertyware/models/unit.rb', line 263 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Propertyware::Unit` 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 `Propertyware::Unit`. 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?(:'abbreviation') self.abbreviation = attributes[:'abbreviation'] end if attributes.key?(:'active') self.active = attributes[:'active'] end if attributes.key?(:'address') self.address = attributes[:'address'] end if attributes.key?(:'amenities') if (value = attributes[:'amenities']).is_a?(Array) self.amenities = value end end if attributes.key?(:'area_units') self.area_units = attributes[:'area_units'] end if attributes.key?(:'building_id') self.building_id = attributes[:'building_id'] end if attributes.key?(:'category') self.category = attributes[:'category'] end if attributes.key?(:'county') self.county = attributes[:'county'] end if attributes.key?(:'created_by') self.created_by = attributes[:'created_by'] end if attributes.key?(:'created_date_time') self.created_date_time = attributes[:'created_date_time'] end if attributes.key?(:'custom_fields') if (value = attributes[:'custom_fields']).is_a?(Array) self.custom_fields = value end end if attributes.key?(:'floor_number') self.floor_number = attributes[:'floor_number'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'id_number') self.id_number = attributes[:'id_number'] end if attributes.key?(:'last_modified_by') self.last_modified_by = attributes[:'last_modified_by'] end if attributes.key?(:'last_modified_date_time') self.last_modified_date_time = attributes[:'last_modified_date_time'] end if attributes.key?(:'lease_id') self.lease_id = attributes[:'lease_id'] end if attributes.key?(:'maintenance_notice') self.maintenance_notice = attributes[:'maintenance_notice'] end if attributes.key?(:'maintenance_spending_limit_time') self.maintenance_spending_limit_time = attributes[:'maintenance_spending_limit_time'] end if attributes.key?(:'management') self.management = attributes[:'management'] end if attributes.key?(:'marketing') self.marketing = attributes[:'marketing'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'neighborhood') self.neighborhood = attributes[:'neighborhood'] end if attributes.key?(:'number_floors') self.number_floors = attributes[:'number_floors'] end if attributes.key?(:'number_of_bathrooms') self.number_of_bathrooms = attributes[:'number_of_bathrooms'] end if attributes.key?(:'number_of_bedrooms') self.number_of_bedrooms = attributes[:'number_of_bedrooms'] end if attributes.key?(:'portfolio_id') self.portfolio_id = attributes[:'portfolio_id'] end if attributes.key?(:'property_manager_list') if (value = attributes[:'property_manager_list']).is_a?(Array) self.property_manager_list = value end end if attributes.key?(:'ready') self.ready = attributes[:'ready'] end if attributes.key?(:'rentable') self.rentable = attributes[:'rentable'] end if attributes.key?(:'search_tag') self.search_tag = attributes[:'search_tag'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'syndicate') self.syndicate = attributes[:'syndicate'] end if attributes.key?(:'target_deposit') self.target_deposit = attributes[:'target_deposit'] end if attributes.key?(:'target_rent') self.target_rent = attributes[:'target_rent'] end if attributes.key?(:'target_rent_units') self.target_rent_units = attributes[:'target_rent_units'] end if attributes.key?(:'total_area') self.total_area = attributes[:'total_area'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'website') self.website = attributes[:'website'] end if attributes.key?(:'year_built') self.year_built = attributes[:'year_built'] end end |
Instance Attribute Details
#abbreviation ⇒ Object
Property abbreviation.
20 21 22 |
# File 'lib/propertyware/models/unit.rb', line 20 def abbreviation @abbreviation end |
#active ⇒ Object
Indicates if the property is active or inactive.
23 24 25 |
# File 'lib/propertyware/models/unit.rb', line 23 def active @active end |
#address ⇒ Object
Returns the value of attribute address.
25 26 27 |
# File 'lib/propertyware/models/unit.rb', line 25 def address @address end |
#amenities ⇒ Object
Property amenities list.
28 29 30 |
# File 'lib/propertyware/models/unit.rb', line 28 def amenities @amenities end |
#area_units ⇒ Object
Property total area units.
31 32 33 |
# File 'lib/propertyware/models/unit.rb', line 31 def area_units @area_units end |
#building_id ⇒ Object
Id of the building associated with this unit.
34 35 36 |
# File 'lib/propertyware/models/unit.rb', line 34 def building_id @building_id end |
#category ⇒ Object
Property category.
37 38 39 |
# File 'lib/propertyware/models/unit.rb', line 37 def category @category end |
#county ⇒ Object
Property region of a state.
40 41 42 |
# File 'lib/propertyware/models/unit.rb', line 40 def county @county end |
#created_by ⇒ Object
User who created the record.
43 44 45 |
# File 'lib/propertyware/models/unit.rb', line 43 def created_by @created_by end |
#created_date_time ⇒ Object
Date and time the record was created. (Timezone: UTC)
46 47 48 |
# File 'lib/propertyware/models/unit.rb', line 46 def created_date_time @created_date_time end |
#custom_fields ⇒ Object
Custom fields.
49 50 51 |
# File 'lib/propertyware/models/unit.rb', line 49 def custom_fields @custom_fields end |
#floor_number ⇒ Object
Floor number.
52 53 54 |
# File 'lib/propertyware/models/unit.rb', line 52 def floor_number @floor_number end |
#id ⇒ Object
Unique identifier.
55 56 57 |
# File 'lib/propertyware/models/unit.rb', line 55 def id @id end |
#id_number ⇒ Object
Unique identifier for Global Search.
58 59 60 |
# File 'lib/propertyware/models/unit.rb', line 58 def id_number @id_number end |
#last_modified_by ⇒ Object
User who last modified the record.
61 62 63 |
# File 'lib/propertyware/models/unit.rb', line 61 def last_modified_by @last_modified_by end |
#last_modified_date_time ⇒ Object
Date and time the record was last modified. (Timezone: UTC)
64 65 66 |
# File 'lib/propertyware/models/unit.rb', line 64 def last_modified_date_time @last_modified_date_time end |
#lease_id ⇒ Object
Related lease ID.
67 68 69 |
# File 'lib/propertyware/models/unit.rb', line 67 def lease_id @lease_id end |
#maintenance_notice ⇒ Object
Property maintenance description.
70 71 72 |
# File 'lib/propertyware/models/unit.rb', line 70 def maintenance_notice @maintenance_notice end |
#maintenance_spending_limit_time ⇒ Object
Property maintenance spending limit.
73 74 75 |
# File 'lib/propertyware/models/unit.rb', line 73 def maintenance_spending_limit_time @maintenance_spending_limit_time end |
#management ⇒ Object
Returns the value of attribute management.
75 76 77 |
# File 'lib/propertyware/models/unit.rb', line 75 def management @management end |
#marketing ⇒ Object
Returns the value of attribute marketing.
77 78 79 |
# File 'lib/propertyware/models/unit.rb', line 77 def marketing @marketing end |
#name ⇒ Object
Name of the property.
80 81 82 |
# File 'lib/propertyware/models/unit.rb', line 80 def name @name end |
#neighborhood ⇒ Object
Property neighborhood.
83 84 85 |
# File 'lib/propertyware/models/unit.rb', line 83 def neighborhood @neighborhood end |
#number_floors ⇒ Object
Number floors
86 87 88 |
# File 'lib/propertyware/models/unit.rb', line 86 def number_floors @number_floors end |
#number_of_bathrooms ⇒ Object
Number of bathrooms in the property.
89 90 91 |
# File 'lib/propertyware/models/unit.rb', line 89 def number_of_bathrooms @number_of_bathrooms end |
#number_of_bedrooms ⇒ Object
Number of bedrooms in the property.
92 93 94 |
# File 'lib/propertyware/models/unit.rb', line 92 def number_of_bedrooms @number_of_bedrooms end |
#portfolio_id ⇒ Object
ID of the portfolio associated with this property.
95 96 97 |
# File 'lib/propertyware/models/unit.rb', line 95 def portfolio_id @portfolio_id end |
#property_manager_list ⇒ Object
Property manager details.
98 99 100 |
# File 'lib/propertyware/models/unit.rb', line 98 def property_manager_list @property_manager_list end |
#ready ⇒ Object
Indicates if the property is ready to lease.
101 102 103 |
# File 'lib/propertyware/models/unit.rb', line 101 def ready @ready end |
#rentable ⇒ Object
Indicates if the property is available for rent.
104 105 106 |
# File 'lib/propertyware/models/unit.rb', line 104 def rentable @rentable end |
#search_tag ⇒ Object
Property search tag.
107 108 109 |
# File 'lib/propertyware/models/unit.rb', line 107 def search_tag @search_tag end |
#status ⇒ Object
Property status (occupied/vacant).
110 111 112 |
# File 'lib/propertyware/models/unit.rb', line 110 def status @status end |
#syndicate ⇒ Object
Property syndicate.
113 114 115 |
# File 'lib/propertyware/models/unit.rb', line 113 def syndicate @syndicate end |
#target_deposit ⇒ Object
Target deposit.
116 117 118 |
# File 'lib/propertyware/models/unit.rb', line 116 def target_deposit @target_deposit end |
#target_rent ⇒ Object
Property target rent.
119 120 121 |
# File 'lib/propertyware/models/unit.rb', line 119 def target_rent @target_rent end |
#target_rent_units ⇒ Object
Property target rent units.
122 123 124 |
# File 'lib/propertyware/models/unit.rb', line 122 def target_rent_units @target_rent_units end |
#total_area ⇒ Object
Property total area.
125 126 127 |
# File 'lib/propertyware/models/unit.rb', line 125 def total_area @total_area end |
#type ⇒ Object
Property type.
128 129 130 |
# File 'lib/propertyware/models/unit.rb', line 128 def type @type end |
#website ⇒ Object
Property website URL.
131 132 133 |
# File 'lib/propertyware/models/unit.rb', line 131 def website @website end |
#year_built ⇒ Object
Property built year.
134 135 136 |
# File 'lib/propertyware/models/unit.rb', line 134 def year_built @year_built end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
205 206 207 |
# File 'lib/propertyware/models/unit.rb', line 205 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/propertyware/models/unit.rb', line 159 def self.attribute_map { :'abbreviation' => :'abbreviation', :'active' => :'active', :'address' => :'address', :'amenities' => :'amenities', :'area_units' => :'areaUnits', :'building_id' => :'buildingID', :'category' => :'category', :'county' => :'county', :'created_by' => :'createdBy', :'created_date_time' => :'createdDateTime', :'custom_fields' => :'customFields', :'floor_number' => :'floorNumber', :'id' => :'id', :'id_number' => :'idNumber', :'last_modified_by' => :'lastModifiedBy', :'last_modified_date_time' => :'lastModifiedDateTime', :'lease_id' => :'leaseID', :'maintenance_notice' => :'maintenanceNotice', :'maintenance_spending_limit_time' => :'maintenanceSpendingLimitTime', :'management' => :'management', :'marketing' => :'marketing', :'name' => :'name', :'neighborhood' => :'neighborhood', :'number_floors' => :'numberFloors', :'number_of_bathrooms' => :'numberOfBathrooms', :'number_of_bedrooms' => :'numberOfBedrooms', :'portfolio_id' => :'portfolioID', :'property_manager_list' => :'propertyManagerList', :'ready' => :'ready', :'rentable' => :'rentable', :'search_tag' => :'searchTag', :'status' => :'status', :'syndicate' => :'syndicate', :'target_deposit' => :'targetDeposit', :'target_rent' => :'targetRent', :'target_rent_units' => :'targetRentUnits', :'total_area' => :'totalArea', :'type' => :'type', :'website' => :'website', :'year_built' => :'yearBuilt' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
566 567 568 |
# File 'lib/propertyware/models/unit.rb', line 566 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
256 257 258 259 |
# File 'lib/propertyware/models/unit.rb', line 256 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/propertyware/models/unit.rb', line 210 def self.openapi_types { :'abbreviation' => :'String', :'active' => :'Boolean', :'address' => :'Address', :'amenities' => :'Array<Amenity>', :'area_units' => :'String', :'building_id' => :'Integer', :'category' => :'String', :'county' => :'String', :'created_by' => :'String', :'created_date_time' => :'Time', :'custom_fields' => :'Array<CustomField>', :'floor_number' => :'Integer', :'id' => :'Integer', :'id_number' => :'Integer', :'last_modified_by' => :'String', :'last_modified_date_time' => :'Time', :'lease_id' => :'Integer', :'maintenance_notice' => :'String', :'maintenance_spending_limit_time' => :'String', :'management' => :'ManagementSettings', :'marketing' => :'Marketing', :'name' => :'String', :'neighborhood' => :'String', :'number_floors' => :'Integer', :'number_of_bathrooms' => :'Float', :'number_of_bedrooms' => :'Integer', :'portfolio_id' => :'Integer', :'property_manager_list' => :'Array<PropertyManager>', :'ready' => :'Boolean', :'rentable' => :'Boolean', :'search_tag' => :'String', :'status' => :'String', :'syndicate' => :'Boolean', :'target_deposit' => :'Float', :'target_rent' => :'Float', :'target_rent_units' => :'String', :'total_area' => :'Float', :'type' => :'String', :'website' => :'String', :'year_built' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 |
# File 'lib/propertyware/models/unit.rb', line 506 def ==(o) return true if self.equal?(o) self.class == o.class && abbreviation == o.abbreviation && active == o.active && address == o.address && amenities == o.amenities && area_units == o.area_units && building_id == o.building_id && category == o.category && county == o.county && created_by == o.created_by && created_date_time == o.created_date_time && custom_fields == o.custom_fields && floor_number == o.floor_number && id == o.id && id_number == o.id_number && last_modified_by == o.last_modified_by && last_modified_date_time == o.last_modified_date_time && lease_id == o.lease_id && maintenance_notice == o.maintenance_notice && maintenance_spending_limit_time == o.maintenance_spending_limit_time && management == o.management && marketing == o.marketing && name == o.name && neighborhood == o.neighborhood && number_floors == o.number_floors && number_of_bathrooms == o.number_of_bathrooms && number_of_bedrooms == o.number_of_bedrooms && portfolio_id == o.portfolio_id && property_manager_list == o.property_manager_list && ready == o.ready && rentable == o.rentable && search_tag == o.search_tag && status == o.status && syndicate == o.syndicate && target_deposit == o.target_deposit && target_rent == o.target_rent && target_rent_units == o.target_rent_units && total_area == o.total_area && type == o.type && website == o.website && year_built == o.year_built end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/propertyware/models/unit.rb', line 597 def _deserialize(type, value) case type.to_sym when :Time Time.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 # models (e.g. Pet) or oneOf klass = Propertyware.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
668 669 670 671 672 673 674 675 676 677 678 679 680 |
# File 'lib/propertyware/models/unit.rb', line 668 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
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 |
# File 'lib/propertyware/models/unit.rb', line 573 def build_from_hash(attributes) return unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif 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 end self end |
#eql?(o) ⇒ Boolean
553 554 555 |
# File 'lib/propertyware/models/unit.rb', line 553 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
559 560 561 |
# File 'lib/propertyware/models/unit.rb', line 559 def hash [abbreviation, active, address, amenities, area_units, building_id, category, county, created_by, created_date_time, custom_fields, floor_number, id, id_number, last_modified_by, last_modified_date_time, lease_id, maintenance_notice, maintenance_spending_limit_time, management, marketing, name, neighborhood, number_floors, number_of_bathrooms, number_of_bedrooms, portfolio_id, property_manager_list, ready, rentable, search_tag, status, syndicate, target_deposit, target_rent, target_rent_units, total_area, type, website, year_built].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
445 446 447 448 |
# File 'lib/propertyware/models/unit.rb', line 445 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
644 645 646 |
# File 'lib/propertyware/models/unit.rb', line 644 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
650 651 652 653 654 655 656 657 658 659 660 661 662 |
# File 'lib/propertyware/models/unit.rb', line 650 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
638 639 640 |
# File 'lib/propertyware/models/unit.rb', line 638 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/propertyware/models/unit.rb', line 452 def valid? area_units_validator = EnumAttributeValidator.new('String', ["Sq Ft", "Sq M"]) return false unless area_units_validator.valid?(@area_units) category_validator = EnumAttributeValidator.new('String', ["RESIDENTIAL", "COMMERCIAL"]) return false unless category_validator.valid?(@category) maintenance_spending_limit_time_validator = EnumAttributeValidator.new('String', ["NO_LIMIT", "MONTHLY_LIMIT", "YEARLY_LIMIT"]) return false unless maintenance_spending_limit_time_validator.valid?(@maintenance_spending_limit_time) target_rent_units_validator = EnumAttributeValidator.new('String', ["DOLLAR_PER_SQ_FT_MONTH", "DOLLAR_PER_SQ_FT_YEAR", "DOLLAR_PER_SQ_M_MONTH", "DOLLAR_PER_SQ_M_YEAR", "DOLLAR_PER_MONTH", "DOLLAR_PER_WEEK", "DOLLAR_PER_NIGHT"]) return false unless target_rent_units_validator.valid?(@target_rent_units) true end |