Class: Tend::Contact
- Includes:
- Util::NoPost
- Defined in:
- lib/tend/models/contact.rb
Constant Summary collapse
- ATTRIBUTES =
[:id, :name, :firstName, :lastName, :email, :company, :title, :bio, :website, :address, :city, :state, :zip, :country, :photo, :facebook, :twitter, :linkedin, :activity, :segments, :referrers, :campaigns]
Instance Attribute Summary
Attributes inherited from Garden
Instance Method Summary collapse
-
#initialize(*args) ⇒ Contact
constructor
A new instance of Contact.
- #segments(options = {}) ⇒ Object
- #visits(options = {}) ⇒ Object
Methods included from Util::NoPost
Methods inherited from Garden
Methods included from Util::Util
Methods included from Util::Ht
Constructor Details
#initialize(*args) ⇒ Contact
Returns a new instance of Contact.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/tend/models/contact.rb', line 9 def initialize *args init(*args) do |att, value| case att when :segments a = [] value.each do |h| a << Tend::Segment.new( h ) end @segments = a when :campaign a = [] value.each do |h| a << Tend::Campaign.new( h ) end @campaigns = a when :referrer a = [] value.each do |h| a << Tend::Referrer.new( h ) end @referrers = a else send("#{att}=", value) end end end |