Module: Moist::Models::Campaign

Included in:
Campaign
Defined in:
lib/moist/models/campaign.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



4
5
6
# File 'lib/moist/models/campaign.rb', line 4

def self.included(klass)
  klass.extend ClassMethods
end

Instance Method Details

#stepsObject



8
9
10
# File 'lib/moist/models/campaign.rb', line 8

def steps
  Steps::Collection.for(self)
end

#subscribed?(subscriber, **args) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/moist/models/campaign.rb', line 16

def subscribed?(subscriber, **args)
  moist_campaign_subscribers.exists?(subscriber: subscriber, **args)
end

#to_slugObject



12
13
14
# File 'lib/moist/models/campaign.rb', line 12

def to_slug
  slug.to_sym
end