Class: Rentjuicer::Lead
- Inherits:
-
Object
- Object
- Rentjuicer::Lead
- Defined in:
- lib/rentjuicer/lead.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
- #create(name, params = {}, raise_error = false) ⇒ Object
- #create!(name, params = {}) ⇒ Object
-
#initialize(client) ⇒ Lead
constructor
A new instance of Lead.
Constructor Details
#initialize(client) ⇒ Lead
Returns a new instance of Lead.
6 7 8 9 |
# File 'lib/rentjuicer/lead.rb', line 6 def initialize(client) self.client = client self.resource = "/leads.add.json" end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/rentjuicer/lead.rb', line 4 def client @client end |
#resource ⇒ Object
Returns the value of attribute resource.
4 5 6 |
# File 'lib/rentjuicer/lead.rb', line 4 def resource @resource end |
Instance Method Details
#create(name, params = {}, raise_error = false) ⇒ Object
11 12 13 14 |
# File 'lib/rentjuicer/lead.rb', line 11 def create(name, params = {}, raise_error = false) params.merge!(:name => name) Response.new(self.client.process_get(resource, params), raise_error) end |
#create!(name, params = {}) ⇒ Object
16 17 18 |
# File 'lib/rentjuicer/lead.rb', line 16 def create!(name, params = {}) create(name, params = {}, true) end |