Class: ConstantContact::List

Inherits:
Base
  • Object
show all
Defined in:
lib/constant_contact/list.rb

Constant Summary

Constants inherited from Base

Base::DATE_FORMAT

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#after_save, api_key, api_key=, #before_save, collection_path, connection, element_path, #encode, find_every, #html_encode, #int_id, #method_missing, parse_id, #save, #update_attributes, #valid?, #validate

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ConstantContact::Base

Class Method Details

.find_by_name(name) ⇒ Object


13
14
15
16
# File 'lib/constant_contact/list.rb', line 13

def self.find_by_name(name)
  lists = self.find :all
  lists.find{|list| list.Name == name}
end

Instance Method Details

#to_xmlObject

@@column_names = [:contact_count, :display_on_signup, :members, :name, :opt_in_default, :short_name, :sort_order]


6
7
8
9
10
11
# File 'lib/constant_contact/list.rb', line 6

def to_xml
  xml = Builder::XmlMarkup.new
  xml.tag!("ContactList", :xmlns => "http://ws.constantcontact.com/ns/1.0/") do
    self.attributes.each{|k, v| xml.tag!( k.to_s.camelize, v )}
  end
end