Module: FactoryScenarios::Mail

Defined in:
lib/factory_scenarios/mail.rb

Defined Under Namespace

Classes: Preview

Constant Summary collapse

@@previews =
{}

Class Method Summary collapse

Class Method Details

.previewsObject



18
19
20
# File 'lib/factory_scenarios/mail.rb', line 18

def self.previews
  @@previews
end

.register(name, &block) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/factory_scenarios/mail.rb', line 5

def self.register(name, &block)
  preview = Preview.new
  preview.instance_eval(&block)
  preview.name(name)
  (@@previews[preview.mailer.name] ||= {})[name] = preview
  preview
end

.registrations(&block) ⇒ Object



13
14
15
16
# File 'lib/factory_scenarios/mail.rb', line 13

def self.registrations(&block)
  @@previews = {}
  instance_eval(&block)
end