Class: Yardi::Parameter::User

Inherits:
Object
  • Object
show all
Defined in:
lib/yardi/parameter/user.rb

Overview

Wraps the user-related data that we pass to Yardi.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(beds:, contact_info:, first_name:, id:, last_name:, message:, move_in_date:, preference_notes:, preferred_floorplan_id:, price:, preferred_unit_id: nil) ⇒ User

Returns a new instance of User.

Parameters:

  • beds (Integer)

    Number of beds the renter is interested in

  • contact_info (Parameter::ContactInfo)

    Renter contact information

  • first_name (String)

    Renter first name

  • id (Integer)

    ID of the renter in Apartment List database, user.id

  • last_name (String)

    Renter last name

  • message (String)

    Message from the renter to the property

  • move_in_date (Date)

    Renter move in date

  • preference_notes (String)

    Notes to be inserted into Comments node of CustomerPreferences section of guest card

  • preferred_floorplan_id (String)

    ID of Yardi floorplan the renter is interested in. MUST be a real floorplan on the property in Yardi’s system. The list of floorplans can be seen with a UnitAvailability_Login request.

  • preferred_unit_id (String) (defaults to: nil)

    ID of Yardi unit the renter is interested in. If specified, it MUST be a real unit on the property in Yardi’s system. The list of units can be seen with a UnitAvailability_Login request. This param is only required when inserting a tour.

  • price (Integer)

    Renter budget



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/yardi/parameter/user.rb', line 36

def initialize(
  beds:,
  contact_info:,
  first_name:,
  id:,
  last_name:,
  message:,
  move_in_date:,
  preference_notes:,
  preferred_floorplan_id:,
  price:, preferred_unit_id: nil
)

  @beds = beds.nil? || beds == '' ? nil : beds.to_i
  @contact_info = contact_info
  @first_name = first_name
  @id = id
  @last_name = last_name
  @message = message
  @move_in_date = move_in_date
  @preference_notes = preference_notes
  @preferred_floorplan_id = preferred_floorplan_id
  @preferred_unit_id = preferred_unit_id
  @price = price.to_i > 0 ? price.to_i : nil
end

Instance Attribute Details

#bedsObject (readonly)

Returns the value of attribute beds.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def beds
  @beds
end

#contact_infoObject (readonly)

Returns the value of attribute contact_info.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def contact_info
  @contact_info
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def first_name
  @first_name
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def id
  @id
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def last_name
  @last_name
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def message
  @message
end

#move_in_dateObject (readonly)

Returns the value of attribute move_in_date.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def move_in_date
  @move_in_date
end

#preference_notesObject (readonly)

Returns the value of attribute preference_notes.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def preference_notes
  @preference_notes
end

#preferred_floorplan_idObject (readonly)

Returns the value of attribute preferred_floorplan_id.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def preferred_floorplan_id
  @preferred_floorplan_id
end

#preferred_unit_idObject (readonly)

Returns the value of attribute preferred_unit_id.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def preferred_unit_id
  @preferred_unit_id
end

#priceObject (readonly)

Returns the value of attribute price.



5
6
7
# File 'lib/yardi/parameter/user.rb', line 5

def price
  @price
end