Module: E9Crm

Defined in:
lib/e9_crm.rb,
lib/e9_crm/model.rb,
lib/e9_crm/version.rb,
lib/e9_crm/controller.rb,
lib/e9_crm/e9_extensions.rb,
lib/e9_crm/tracking_controller.rb,
lib/e9_crm/system_emails_controller.rb,
lib/generators/e9_crm/install_generator.rb,
lib/e9_crm/rails_extensions.rb

Defined Under Namespace

Modules: BaseHelper, CampaignGroupsHelper, CampaignsHelper, CompaniesHelper, ContactMergesHelper, ContactsHelper, Controller, DealsHelper, Email, EmailTemplatesHelper, Generators, LeadsHelper, MenuOptionsHelper, Model, OffersHelper, PageViewsHelper, Rack, SystemEmailsController, TrackingController Classes: AdvertisingCampaignsController, AffiliateCampaignsController, BaseController, CampaignGroupsController, CampaignSubclassController, CampaignsController, CompaniesController, ContactEmailsController, ContactMergesController, ContactsController, DatedCostsController, DealsController, EmailCampaignsController, Engine, LabeledString, LeadsController, OffersController, ResourcesController, SalesCampaignsController, UsersController, VisitsController

Constant Summary collapse

VERSION =
'0.1.34'
'_e9_tc'
@@query_param =
'code'
@@query_user_id =
'cuid'
@@log_level =
:debug
@@logging =
false
@@user_model =
nil
@@tracking_controllers =
[]

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (E9Crm)

    the object that the method was called on



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

def E9Crm.configure
  yield self
end

.init!Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/e9_crm.rb', line 48

def E9Crm.init!
  user_model = case @@user_model
  when Class; @@user_model
  when String, Symbol; @@user_model.classify.constantize
  end

  if user_model
    user_model.send(:include, E9Crm::Model)
  end

  ActionController::Base.send(:include, E9Crm::Controller)

  ::Admin::SystemEmailsController.send(:include, E9Crm::SystemEmailsController)

  E9Crm.tracking_controllers.each do |controller|
    controller.send(:include, E9Crm::TrackingController)
  end

  MenuOption.keys |= %w(Deal\ Category)
end

.log(message) ⇒ Object



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

def E9Crm.log(message)
  Rails.logger.send(@@log_level, "e9Crm: #{message}") if @@logging
end