constant_contact 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -49,7 +49,7 @@ All examples require setting up either the specific class you'll be use or the B
49
49
  ### Find a Contact By Email Address, Check if They're a Member of the Default List
50
50
 
51
51
  c = ConstantContact::Contact.find_by_email('jon@example.com')
52
- @contact = ConstantContact::Contact.find(@contact.int_id)
52
+ @contact = ConstantContact::Contact.find(c.int_id) # Because Constant Contact doesn't return a full contact when searching by email
53
53
  puts 'In default contact list.' if @contact.contact_lists.include?(1) # contact_lists is an array of list ids
54
54
 
55
55
 
@@ -133,9 +133,9 @@ module ConstantContact
133
133
  "<entry xmlns=\"http://www.w3.org/2005/Atom\">
134
134
  <title type=\"text\"> </title>
135
135
  <updated>#{Time.now.strftime(DATE_FORMAT)}</updated>
136
- <author>Bluesteel</author>
136
+ <author></author>
137
137
  <id>#{id.blank? ? 'data:,none' : id}</id>
138
- <summary type=\"text\">Bluesteel</summary>
138
+ <summary type=\"text\">#{self.class.name.split('::').last}</summary>
139
139
  <content type=\"application/vnd.ctct+xml\">
140
140
  #{self.to_xml}
141
141
  </content>
@@ -3,6 +3,13 @@ module ConstantContact
3
3
 
4
4
  # @@column_names = [:contact_count, :display_on_signup, :members, :name, :opt_in_default, :short_name, :sort_order]
5
5
 
6
+ def to_xml
7
+ xml = Builder::XmlMarkup.new
8
+ xml.tag!("ContactList", :xmlns => "http://ws.constantcontact.com/ns/1.0/") do
9
+ self.attributes.each{|k, v| xml.tag!( k.to_s.camelize, v )}
10
+ end
11
+ end
12
+
6
13
  def self.find_by_name(name)
7
14
  lists = self.find :all
8
15
  lists.find{|list| list.Name == name}
@@ -1,3 +1,3 @@
1
1
  module ConstantContact
2
- Version = '1.1.5'.freeze
2
+ Version = '1.1.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: constant_contact
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 5
10
- version: 1.1.5
9
+ - 6
10
+ version: 1.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Case
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2010-09-23 00:00:00 -04:00
21
+ date: 2010-10-26 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency