Module: EmailPreview
- Defined in:
- lib/email_preview.rb,
lib/email_preview/engine.rb,
lib/email_preview/fixture.rb,
lib/email_preview/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"1.5.4"
Class Attribute Summary collapse
-
.allowed_environments ⇒ Object
Returns the value of attribute allowed_environments.
-
.before_preview_hook ⇒ Object
Returns the value of attribute before_preview_hook.
-
.delivery_method ⇒ Object
Returns the value of attribute delivery_method.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.registry ⇒ Object
Returns the value of attribute registry.
-
.transactional ⇒ Object
Returns the value of attribute transactional.
Class Method Summary collapse
- .[](key) ⇒ Object
- .before_preview(&block) ⇒ Object
- .categories ⇒ Object
- .preview(key) ⇒ Object
- .register(description, options = {}, &block) ⇒ Object
- .transactional? ⇒ Boolean
Class Attribute Details
.allowed_environments ⇒ Object
Returns the value of attribute allowed_environments.
8 9 10 |
# File 'lib/email_preview.rb', line 8 def allowed_environments @allowed_environments end |
.before_preview_hook ⇒ Object
Returns the value of attribute before_preview_hook.
11 12 13 |
# File 'lib/email_preview.rb', line 11 def before_preview_hook @before_preview_hook end |
.delivery_method ⇒ Object
Returns the value of attribute delivery_method.
12 13 14 |
# File 'lib/email_preview.rb', line 12 def delivery_method @delivery_method end |
.logger ⇒ Object
Returns the value of attribute logger.
10 11 12 |
# File 'lib/email_preview.rb', line 10 def logger @logger end |
.registry ⇒ Object
Returns the value of attribute registry.
7 8 9 |
# File 'lib/email_preview.rb', line 7 def registry @registry end |
.transactional ⇒ Object
Returns the value of attribute transactional.
9 10 11 |
# File 'lib/email_preview.rb', line 9 def transactional @transactional end |
Class Method Details
.[](key) ⇒ Object
25 26 27 |
# File 'lib/email_preview.rb', line 25 def [](key) self.registry[key.to_i] end |
.before_preview(&block) ⇒ Object
31 32 33 |
# File 'lib/email_preview.rb', line 31 def before_preview(&block) @before_preview_hook = block end |
.categories ⇒ Object
18 19 20 |
# File 'lib/email_preview.rb', line 18 def categories self.registry.collect {|f| f.category }.uniq end |
.preview(key) ⇒ Object
21 22 23 24 |
# File 'lib/email_preview.rb', line 21 def preview(key) EmailPreview.before_preview_hook.call self[key].preview end |
.register(description, options = {}, &block) ⇒ Object
14 15 16 17 |
# File 'lib/email_preview.rb', line 14 def register(description, ={}, &block) fixture = EmailPreview::Fixture.new(description, , &block) self.registry << fixture end |
.transactional? ⇒ Boolean
28 29 30 |
# File 'lib/email_preview.rb', line 28 def transactional? !!self.transactional end |