class SparkApi::Models::Contact

Public Class Methods

by_tag(tag_name, arguments={}) click to toggle source
# 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={}) click to toggle source
# File lib/spark_api/models/contact.rb, line 22
def self.export(arguments={})
  collect(connection.get("/contacts/export", arguments))
end
export_all(arguments={}) click to toggle source
# File lib/spark_api/models/contact.rb, line 26
def self.export_all(arguments={})
  collect(connection.get("/contacts/export/all", arguments))
end
my(arguments={}) click to toggle source
# File lib/spark_api/models/contact.rb, line 18
def self.my(arguments={})
  new(connection.get('/my/contact', arguments).first)
end
tags(arguments={}) click to toggle source
# File lib/spark_api/models/contact.rb, line 14
def self.tags(arguments={})
  connection.get("#{path}/tags", arguments)
end

Public Instance Methods

comment(body) click to toggle source
# File lib/spark_api/models/contact.rb, line 51
def comment(body)
  comment = Comment.new({ :Comment => body })
  comment.parent = self
  comment.save
  comment
end
comments(arguments = {}) click to toggle source
# File lib/spark_api/models/contact.rb, line 48
def comments(arguments = {})
  @comments ||= Comment.collect(connection.get("/contacts/#{self.Id}/comments", arguments))
end
listing_carts(arguments = {}) click to toggle source
# 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) click to toggle source
# File lib/spark_api/models/contact.rb, line 32
def notify=(notify_me)
  params_for_save[:Notify] = notify_me
end
notify?() click to toggle source

Notify the agent of contact creation via a Spark notification.

# File lib/spark_api/models/contact.rb, line 31
def notify?; params_for_save[:Notify] == true end
provided_searches(arguments = {}) click to toggle source
# 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 = {}) click to toggle source
# 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={}) click to toggle source
# 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