Class: RepsClient::Prospect

Inherits:
Modelish::Base
  • Object
show all
Defined in:
lib/reps_client/lead.rb

Overview

The person on whose behalf the lead was submitted; the prospective resident.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#address1String

Returns the first line of the prospect’s street address.

Returns:

  • (String)

    the first line of the prospect’s street address



200
# File 'lib/reps_client/lead.rb', line 200

property :address1, :type => String, :max_length => 100

#address2String

Returns the second line of the prospect’s street address.

Returns:

  • (String)

    the second line of the prospect’s street address



204
# File 'lib/reps_client/lead.rb', line 204

property :address2, :type => String, :max_length => 100

#cityString

Returns the city for the prospect’s mailing address.

Returns:

  • (String)

    the city for the prospect’s mailing address



208
# File 'lib/reps_client/lead.rb', line 208

property :city, :type => String, :max_length => 50

#countryString

Returns the country for the prospect’s mailing address.

Returns:

  • (String)

    the country for the prospect’s mailing address



220
# File 'lib/reps_client/lead.rb', line 220

property :country, :type => String

#emailString

Returns the prospect’s email address.

Returns:

  • (String)

    the prospect’s email address



232
# File 'lib/reps_client/lead.rb', line 232

property :email, :type => String, :max_length => 100

#first_nameString

Returns the prospect’s first name.

Returns:

  • (String)

    the prospect’s first name



179
# File 'lib/reps_client/lead.rb', line 179

property :first_name, :type => String, :max_length => 30

#include_in_emailingstrue, false

Returns true if prospect opts in to emailings, false otherwise (defaults to false).

Returns:

  • (true, false)

    true if prospect opts in to emailings, false otherwise (defaults to false)



244
# File 'lib/reps_client/lead.rb', line 244

property :include_in_emailings, :default => false, :type => lambda { |v| !!v }

#include_in_mailingstrue, false

Returns true if prospect opts in to mailings, false otherwise (defaults to false).

Returns:

  • (true, false)

    true if prospect opts in to mailings, false otherwise (defaults to false)



240
# File 'lib/reps_client/lead.rb', line 240

property :include_in_mailings, :default => false, :type => lambda { |v| !!v }

#last_nameString

Returns the prospect’s last name.

Returns:

  • (String)

    the prospect’s last name



187
# File 'lib/reps_client/lead.rb', line 187

property :last_name, :type => String, :max_length => 30

#middle_nameString

Returns the prospect’s middle name.

Returns:

  • (String)

    the prospect’s middle name



183
# File 'lib/reps_client/lead.rb', line 183

property :middle_name, :type => String, :max_length => 30

#nicknameString

Returns the prospect’s nickname.

Returns:

  • (String)

    the prospect’s nickname



196
# File 'lib/reps_client/lead.rb', line 196

property :nickname, :type => String, :max_length => 30

#notesString

Returns notes on the prospect (maximum 250 characters).

Returns:

  • (String)

    notes on the prospect (maximum 250 characters)



236
# File 'lib/reps_client/lead.rb', line 236

property :notes, :type => String

#phoneString

Returns the prospect’s phone number.

Returns:

  • (String)

    the prospect’s phone number



224
# File 'lib/reps_client/lead.rb', line 224

property :phone, :type => String, :max_length => 20

#phone_extensionString

Returns the prospect’s phone extension.

Returns:

  • (String)

    the prospect’s phone extension



228
# File 'lib/reps_client/lead.rb', line 228

property :phone_extension, :type => String, :max_length => 5

#prefixString

Returns the prospect’s salutation (e.g. ‘Mr.’, ‘Ms.’, ‘Dr.’, etc.).

Returns:

  • (String)

    the prospect’s salutation (e.g. ‘Mr.’, ‘Ms.’, ‘Dr.’, etc.)

See Also:



175
# File 'lib/reps_client/lead.rb', line 175

property :prefix, :type => String, :max_length => 30

#stateString

Returns the state code for the prospect’s mailing address.

Returns:

  • (String)

    the state code for the prospect’s mailing address



212
# File 'lib/reps_client/lead.rb', line 212

property :state, :type => String, :max_length => 2

#suffixString

Returns the prospect’s name suffix (e.g. ‘Jr.’, ‘M.D.’, etc.).

Returns:

  • (String)

    the prospect’s name suffix (e.g. ‘Jr.’, ‘M.D.’, etc.)

See Also:



192
# File 'lib/reps_client/lead.rb', line 192

property :suffix, :type => String, :max_length => 30

#zip_codeString

Returns the zip code for the prospect’s mailing address.

Returns:

  • (String)

    the zip code for the prospect’s mailing address



216
# File 'lib/reps_client/lead.rb', line 216

property :zip_code, :type => String, :max_length => 10

Instance Method Details

#to_soap_hashObject

Wrangle the model into a format that the service will accept



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/reps_client/lead.rb', line 248

def to_soap_hash
  hash = { :order! => [] }

  [:prefix, :first_name, :middle_name, :last_name, :suffix, :nickname,
    :address1, :address2, :city, :state, :zip_code, :country,
    :phone, :phone_extension, :email, :notes, :include_in_mailings,
    :include_in_emailings].each do |prop|
    val = self.send(prop)
    unless val.nil?
      key = prop.to_s.camelcase
      hash[key] = val
      hash[:order!] << key
    end
  end

  hash
end