Class: ConstantContact::Activity

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

Constant Summary

Constant Summary

Constants inherited from Base

Base::DATE_FORMAT

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Base

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

Dynamic Method Handling

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

Instance Attribute Details

- (Object) activity_type

Data is a reserved word in Rails



5
6
7
# File 'lib/constant_contact/activity.rb', line 5

def activity_type
  @activity_type
end

- (Object) contacts

Data is a reserved word in Rails



5
6
7
# File 'lib/constant_contact/activity.rb', line 5

def contacts
  @contacts
end

- (Object) lists

Data is a reserved word in Rails



5
6
7
# File 'lib/constant_contact/activity.rb', line 5

def lists
  @lists
end

- (Object) raw_data

Data is a reserved word in Rails



5
6
7
# File 'lib/constant_contact/activity.rb', line 5

def raw_data
  @raw_data
end

Class Method Details

+ (Object) element_path(id, prefix_options = {}, query_options = nil)



11
12
13
14
15
16
# File 'lib/constant_contact/activity.rb', line 11

def self.element_path(id, prefix_options = {}, query_options = nil)
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
  id_val = parse_id(id)
  id_val = id_val.blank? ? nil : "/#{id_val}"
  "#{collection_path}#{id_val}#{query_string(query_options)}"
end

+ (Object) parse_id(url)



7
8
9
# File 'lib/constant_contact/activity.rb', line 7

def self.parse_id(url)
  url.to_s.split('/').last
end

Instance Method Details

- (Object) encode



18
19
20
21
22
23
# File 'lib/constant_contact/activity.rb', line 18

def encode
  post_data = "activityType=#{self.activity_type}"
  post_data += self.encoded_data
  post_data += self.encoded_lists
  return post_data
end