Sha256: 826dcacd20cac1a1cca3dec9be61a7cacd4ddfa567541b97e2be86d78dfb2ccc

Contents?: true

Size: 645 Bytes

Versions: 5

Compression:

Stored size: 645 Bytes

Contents

# encoding: utf-8
require 'rails_best_practices/core/check'

module RailsBestPractices
  module Prepares
    # Remember the mailer names.
    class MailerPrepare < Core::Check
      include Core::Check::Klassable

      interesting_nodes :class
      interesting_files MAILER_FILES, MODEL_FILES

      def initialize
        @mailers = Prepares.mailers
      end

      # check class node.
      #
      # if it is a subclass of ActionMailer::Base,
      # then remember its class name.
      def start_class(node)
        if "ActionMailer::Base" == current_extend_class_name
          @mailers << @klass
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_best_practices-1.5.3 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.5.2 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.5.1 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.5.0 lib/rails_best_practices/prepares/mailer_prepare.rb
rails_best_practices-1.4.0 lib/rails_best_practices/prepares/mailer_prepare.rb