Class: SparkApi::Models::Contact
Constant Summary
Constants included
from Paginate
Paginate::DEFAULT_PAGE_SIZE
Instance Attribute Summary
Attributes inherited from Base
#attributes, #errors, #parent
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Finders
find, find_one, first, last
#create!, #params_for_save, #post_data, #save, #save!, #update!, #update_attributes
#destroy, #destroy!, #destroyed?, included
Methods inherited from Base
connection, #connection, count, element_name, element_name=, first, get, #id, #initialize, #load, #method_missing, #parse_id, path, #path, #persisted?, prefix, prefix=, #resource_pluralized, #resource_uri, #respond_to?, #to_param, #to_partial_path
Methods included from Paginate
#collect, #paginate, #per_page
Methods included from Dirty
#changed, #changed?, #changed_attributes, #changes, #dirty_attributes, #previous_changes
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class SparkApi::Models::Base
Class Method Details
.by_tag(tag_name, arguments = {}) ⇒ Object
10
11
12
|
# File 'lib/spark_api/models/contact.rb', line 10
def self.by_tag(tag_name, arguments={})
collect(connection.get("#{path}/tags/#{tag_name}", arguments))
end
|
.export(arguments = {}) ⇒ Object
22
23
24
|
# File 'lib/spark_api/models/contact.rb', line 22
def self.export(arguments={})
collect(connection.get("/contacts/export", arguments))
end
|
.export_all(arguments = {}) ⇒ Object
26
27
28
|
# File 'lib/spark_api/models/contact.rb', line 26
def self.export_all(arguments={})
collect(connection.get("/contacts/export/all", arguments))
end
|
.my(arguments = {}) ⇒ Object
18
19
20
|
# File 'lib/spark_api/models/contact.rb', line 18
def self.my(arguments={})
new(connection.get('/my/contact', arguments).first)
end
|
14
15
16
|
# File 'lib/spark_api/models/contact.rb', line 14
def self.tags(arguments={})
connection.get("#{path}/tags", arguments)
end
|
Instance Method Details
51
52
53
54
55
56
|
# File 'lib/spark_api/models/contact.rb', line 51
def (body)
= Comment.new({ :Comment => body })
.parent = self
.save
end
|
48
49
50
|
# File 'lib/spark_api/models/contact.rb', line 48
def (arguments = {})
@comments ||= Comment.collect(connection.get("/contacts/#{self.Id}/comments", arguments))
end
|
#listing_carts(arguments = {}) ⇒ Object
44
45
46
|
# File 'lib/spark_api/models/contact.rb', line 44
def listing_carts(arguments = {})
@listing_carts ||= ListingCart.collect(connection.get("/contacts/#{self.Id}/listingcarts", arguments))
end
|
#notify=(notify_me) ⇒ Object
32
33
34
|
# File 'lib/spark_api/models/contact.rb', line 32
def notify=(notify_me)
params_for_save[:Notify] = notify_me
end
|
#notify? ⇒ Boolean
Notify the agent of contact creation via a Spark notification.
31
|
# File 'lib/spark_api/models/contact.rb', line 31
def notify?; params_for_save[:Notify] == true end
|
#provided_searches(arguments = {}) ⇒ Object
40
41
42
|
# File 'lib/spark_api/models/contact.rb', line 40
def provided_searches(arguments = {})
@provided_searches ||= SavedSearch.collect(connection.get("/contacts/#{self.Id}/provided/savedsearches", arguments))
end
|
#saved_searches(arguments = {}) ⇒ Object
36
37
38
|
# File 'lib/spark_api/models/contact.rb', line 36
def saved_searches(arguments = {})
@saved_searches ||= SavedSearch.collect(connection.get("/contacts/#{self.Id}/savedsearches", arguments))
end
|
#vow_account(arguments = {}) ⇒ Object
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/spark_api/models/contact.rb', line 58
def vow_account(arguments={})
return @vow_account if @vow_account
begin
@vow_account = VowAccount.new(connection.get("/contacts/#{self.Id}/portal", arguments).first)
@vow_account.parent = self
@vow_account
rescue NotFound
nil
end
end
|