Class: MailchimpAPI::CampaignContent

Inherits:
Base
  • Object
show all
Extended by:
Support::Countable
Defined in:
lib/mailchimp_api/resources/campaign_content.rb

Class Method Summary collapse

Methods included from Support::Countable

count

Methods inherited from Base

activate_session, exists?, headers, reset_session, #to_h

Class Method Details

.find(*args) ⇒ Object

CampaignContent doesn’t have an ID ‘/3.0/campaigns/:campaign_id/content` only returns a single object. This overrides ActiveResource::Base#find to massage all calls to grab the one campaign content.



15
16
17
18
19
20
21
22
23
# File 'lib/mailchimp_api/resources/campaign_content.rb', line 15

def find(*args)
  options = args.slice!(1) || {}

  prefix_options, query_options = split_options options[:params]

  path = collection_path prefix_options, query_options

  instantiate_record format.decode(connection.get(path, headers).body), prefix_options
end