Class: Closeio::Rails::Lead
- Defined in:
- app/models/closeio/rails/lead.rb
Instance Attribute Summary collapse
-
#contacts ⇒ Object
readonly
Returns the value of attribute contacts.
Class Method Summary collapse
Methods included from Attributes
Instance Attribute Details
#contacts ⇒ Object (readonly)
Returns the value of attribute contacts.
4 5 6 |
# File 'app/models/closeio/rails/lead.rb', line 4 def contacts @contacts end |
Class Method Details
.all ⇒ Object
6 7 8 9 10 |
# File 'app/models/closeio/rails/lead.rb', line 6 def self.all Closeio::Rails.configuration.client.list_leads("*", paginate: true)[:data].collect do |lead| self.new(lead.to_hash) end end |
.create!(payload) ⇒ Object
22 23 24 |
# File 'app/models/closeio/rails/lead.rb', line 22 def self.create!(payload) Closeio::Rails.configuration.client.create_lead(payload) end |
.find(id) ⇒ Object
18 19 20 |
# File 'app/models/closeio/rails/lead.rb', line 18 def self.find(id) self.new(Closeio::Rails.configuration.client.find_lead(id)) end |
.with_status(status) ⇒ Object
12 13 14 15 16 |
# File 'app/models/closeio/rails/lead.rb', line 12 def self.with_status(status) Closeio::Rails.configuration.client.list_leads("lead_status: #{status}", paginate: true)[:data].collect do |lead| self.new(lead.to_hash) end end |