Class: Yardi::Model::Resident

Inherits:
Object
  • Object
show all
Defined in:
lib/yardi/model/resident.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resident, type:, roommates: nil) ⇒ Resident

Returns a new instance of Resident.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/yardi/model/resident.rb', line 12

def initialize(resident, type:, roommates: nil)
  @status = resident['Status']
  @lease_id = resident['tCode']
  @lease_lead_id = resident['pCode']
  @first_name = resident['FirstName']
  @last_name = resident['LastName']
  @email = resident['Email']
  @unit_name = resident['UnitCode']
  @phones = Utils::PhoneParser.parse(resident['Phone'])
  @move_in_date = parse_date(resident['MoveInDate'])
  @lease_from_date = parse_date(resident['LeaseFromDate'])
  @lease_to_date = parse_date(resident['LeaseToDate'])
  @type = type
  @roommates = roommates || []
  @import_resident_id = resident['import_resident_id']
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def first_name
  @first_name
end

#import_resident_idObject (readonly)

Returns the value of attribute import_resident_id.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def import_resident_id
  @import_resident_id
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def last_name
  @last_name
end

#lease_from_dateObject (readonly)

Returns the value of attribute lease_from_date.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def lease_from_date
  @lease_from_date
end

#lease_idObject (readonly)

Returns the value of attribute lease_id.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def lease_id
  @lease_id
end

#lease_lead_idObject (readonly)

Returns the value of attribute lease_lead_id.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def lease_lead_id
  @lease_lead_id
end

#lease_to_dateObject (readonly)

Returns the value of attribute lease_to_date.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def lease_to_date
  @lease_to_date
end

#move_in_dateObject (readonly)

Returns the value of attribute move_in_date.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def move_in_date
  @move_in_date
end

#phonesObject (readonly)

Returns the value of attribute phones.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def phones
  @phones
end

#roommatesObject (readonly)

Returns the value of attribute roommates.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def roommates
  @roommates
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def status
  @status
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def type
  @type
end

#unit_nameObject (readonly)

Returns the value of attribute unit_name.



8
9
10
# File 'lib/yardi/model/resident.rb', line 8

def unit_name
  @unit_name
end