Sha256: 423f1dfbeae4aa622317bd73c04437e6367cd054ce4fc3d89fe91a5be6977584

Contents?: true

Size: 406 Bytes

Versions: 7

Compression:

Stored size: 406 Bytes

Contents

require 'rails_email_preview/engine'

module RailsEmailPreview
  mattr_accessor :preview_classes

  class << self
    def run_before_render(mail)
      (defined?(@hooks) && @hooks[:before_render] || []).each do |block|
        block.call(mail)
      end
    end

    def before_render(&block)
      ((@hooks ||= {})[:before_render] ||= []) << block
    end

    def setup
      yield self
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_email_preview-0.0.9 lib/rails_email_preview.rb
rails_email_preview-0.0.8 lib/rails_email_preview.rb
rails_email_preview-0.0.7 lib/rails_email_preview.rb
rails_email_preview-0.0.6 lib/rails_email_preview.rb
rails_email_preview-0.0.5 lib/rails_email_preview.rb
rails_email_preview-0.0.4 lib/rails_email_preview.rb
rails_email_preview-0.0.3 lib/rails_email_preview.rb