Class: SfIntegrator::Lead
- Inherits:
-
Object
- Object
- SfIntegrator::Lead
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/sf_integrator/lead.rb
Instance Attribute Summary collapse
-
#company ⇒ Object
Returns the value of attribute company.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#job_title ⇒ Object
Returns the value of attribute job_title.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#website ⇒ Object
Returns the value of attribute website.
Class Method Summary collapse
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(args) ⇒ Lead
constructor
A new instance of Lead.
Constructor Details
#initialize(args) ⇒ Lead
Returns a new instance of Lead.
11 12 13 14 15 16 17 18 19 |
# File 'lib/sf_integrator/lead.rb', line 11 def initialize(args) @first_name = args[:first_name] @last_name = args[:last_name] @email = args[:email] @company = args[:company] @job_title = args[:job_title] @phone = args[:phone] @website = args[:website] end |
Instance Attribute Details
#company ⇒ Object
Returns the value of attribute company.
9 10 11 |
# File 'lib/sf_integrator/lead.rb', line 9 def company @company end |
#email ⇒ Object
Returns the value of attribute email.
9 10 11 |
# File 'lib/sf_integrator/lead.rb', line 9 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
9 10 11 |
# File 'lib/sf_integrator/lead.rb', line 9 def first_name @first_name end |
#job_title ⇒ Object
Returns the value of attribute job_title.
9 10 11 |
# File 'lib/sf_integrator/lead.rb', line 9 def job_title @job_title end |
#last_name ⇒ Object
Returns the value of attribute last_name.
9 10 11 |
# File 'lib/sf_integrator/lead.rb', line 9 def last_name @last_name end |
#phone ⇒ Object
Returns the value of attribute phone.
9 10 11 |
# File 'lib/sf_integrator/lead.rb', line 9 def phone @phone end |
#website ⇒ Object
Returns the value of attribute website.
9 10 11 |
# File 'lib/sf_integrator/lead.rb', line 9 def website @website end |
Class Method Details
.all ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sf_integrator/lead.rb', line 29 def self.all records = client.query('select FirstName, LastName, Email, Company, Title, Phone, Website from Lead') records.map do |record| attributes = { first_name: record.FirstName, last_name: record.LastName, email: record.Email, company: record.Company, job_title: record.Title, phone: record.Phone, website: record.Website } Lead.new(attributes) end end |
Instance Method Details
#create ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/sf_integrator/lead.rb', line 21 def create params = { FirstName: first_name, LastName: last_name, Email: email, Company: company, Title: job_title, Phone: phone, Website: website } self.class.client.create('Lead', params) end |