Class: CampaignMonitor::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/campaign_monitor/base.rb

Overview

Provides access to the lists and campaigns associated with a client

Direct Known Subclasses

Campaign, Client, List, Subscriber

Constant Summary

@@client =
nil

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Base) initialize(*args)



29
30
31
32
# File 'lib/campaign_monitor/base.rb', line 29

def initialize(*args)
  @attributes={}
  @cm_client=@@client
end

Instance Attribute Details

- (Object) attributes (readonly)

Returns the value of attribute attributes



5
6
7
# File 'lib/campaign_monitor/base.rb', line 5

def attributes
  @attributes
end

- (Object) cm_client (readonly)

Returns the value of attribute cm_client



5
6
7
# File 'lib/campaign_monitor/base.rb', line 5

def cm_client
  @cm_client
end

- (Object) result (readonly)

Returns the value of attribute result



5
6
7
# File 'lib/campaign_monitor/base.rb', line 5

def result
  @result
end

Class Method Details

+ (Object) client



9
10
11
# File 'lib/campaign_monitor/base.rb', line 9

def self.client
  @@client
end

+ (Object) client=(a)



13
14
15
# File 'lib/campaign_monitor/base.rb', line 13

def self.client=(a)
  @@client=a
end

Instance Method Details

- (Object) [](k)



17
18
19
20
21
22
23
# File 'lib/campaign_monitor/base.rb', line 17

def [](k)
  if m=self.class.get_data_types[k]
    @attributes[k].send(m)
  else
    @attributes[k]
  end
end

- (Object) []=(k, v)



25
26
27
# File 'lib/campaign_monitor/base.rb', line 25

def []=(k,v)
  @attributes[k]=v
end

- (Object) id



40
41
42
# File 'lib/campaign_monitor/base.rb', line 40

def id
  @attributes[self.class.get_id_field]
end

- (Object) id=(v)



44
45
46
# File 'lib/campaign_monitor/base.rb', line 44

def id=(v)
  @attributes[self.class.get_id_field]=v
end

- (Object) name



48
49
50
# File 'lib/campaign_monitor/base.rb', line 48

def name
  @attributes[self.class.get_name_field]
end