class ActionKitApi::EventCampaign

Attributes

allow_private[RW]

Other/Active

default_event_size[RW]

Other/Active

default_title[RW]

Other/Active

id[RW]

Required

max_event_size[RW]

Other/Active

name[RW]

Required

public_create_page[RW]

Other/Active

public_search_page[RW]

Other/Active

require_email_confirmation[RW]

Other/Active

require_staff_approval[RW]

Other/Active

show_address1[RW]

Other/Active

show_public_description[RW]

Other/Active

show_state[RW]

Other/Active

show_title[RW]

Other/Active

show_venue[RW]

Other/Active

show_zip[RW]

Other/Active

starts_at[RW]

Other/Active

title[RW]

Required

use_start_date[RW]

Other/Active

use_start_time[RW]

Other/Active

use_title[RW]

Other/Active

Public Class Methods

new(*args) click to toggle source
Calls superclass method ActionKitApi::ApiDataModel::new
# File lib/action_kit_api/event_campaign.rb, line 19
def initialize(*args)
  @required_attrs = [:name, :title]
  
  super

  @default_title ||= @title
  @default_event_size ||= 35
  @show_address1 ||= true
end

Public Instance Methods

create_event(*args) click to toggle source

Requires at a minimum the creator_id

# File lib/action_kit_api/event_campaign.rb, line 30
def create_event(*args)
  raise "EventCampaign needs to be saved before Event creation" if self.id.nil?

  (args[0]).merge!(:campaign_id => self.id)

  event = ActionKitApi::Event.new(*args)
end
find_local_events(zip, radius) click to toggle source

Uses public_search so is subject those limitations

# File lib/action_kit_api/event_campaign.rb, line 39
def find_local_events(zip, radius)
  self.public_search(:zip => zip, :radius => radius)
end
stats() click to toggle source
# File lib/action_kit_api/event_campaign.rb, line 56
def stats
  raise "EventCampaign needs to be saved before retrieving stats" if self.id.nil?
  
  ActionKitApi.connection.call("EventCampaign.stats", {:id => self.id})
end