Class: Asdawqw::Pms
Overview
Property Manager model
Instance Attribute Summary collapse
-
#email_address ⇒ String
Email of the property manager.
-
#extra_name ⇒ String
Contact person.
-
#id ⇒ Integer
ID of the property manager.
-
#name ⇒ String
Name of the property manager’s company.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(id = nil, name = nil, extra_name = nil, email_address = nil) ⇒ Pms
constructor
A new instance of Pms.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, name = nil, extra_name = nil, email_address = nil) ⇒ Pms
Returns a new instance of Pms.
35 36 37 38 39 40 41 42 43 |
# File 'lib/asdawqw/models/pms.rb', line 35 def initialize(id = nil, name = nil, extra_name = nil, email_address = nil) @id = id @name = name @extra_name = extra_name @email_address = email_address end |
Instance Attribute Details
#email_address ⇒ String
Email of the property manager
23 24 25 |
# File 'lib/asdawqw/models/pms.rb', line 23 def email_address @email_address end |
#extra_name ⇒ String
Contact person
19 20 21 |
# File 'lib/asdawqw/models/pms.rb', line 19 def extra_name @extra_name end |
#id ⇒ Integer
ID of the property manager
11 12 13 |
# File 'lib/asdawqw/models/pms.rb', line 11 def id @id end |
#name ⇒ String
Name of the property manager’s company
15 16 17 |
# File 'lib/asdawqw/models/pms.rb', line 15 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/asdawqw/models/pms.rb', line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash['id'] name = hash['name'] extra_name = hash['extraName'] email_address = hash['emailAddress'] # Create object from extracted values. Pms.new(id, name, extra_name, email_address) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 33 |
# File 'lib/asdawqw/models/pms.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['extra_name'] = 'extraName' @_hash['email_address'] = 'emailAddress' @_hash end |