Sha256: 97538402e70c07e631da6b4257a97b626d85667e5c9ee955ca1689daa88989c6

Contents?: true

Size: 1.56 KB

Versions: 6

Compression:

Stored size: 1.56 KB

Contents

# encoding: utf-8
require 'rails_best_practices/prepares/model_prepare'
require 'rails_best_practices/prepares/mailer_prepare'
require 'rails_best_practices/prepares/schema_prepare'
require 'rails_best_practices/prepares/controller_prepare'
require 'rails_best_practices/prepares/route_prepare'
require 'rails_best_practices/prepares/helper_prepare'
require 'rails_best_practices/prepares/config_prepare'

module RailsBestPractices
  module Prepares
    class <<self
      def klasses
        models + mailers + controllers
      end

      def models
        @models ||= Core::Models.new
      end

      def model_associations
        @model_associations ||= Core::ModelAssociations.new
      end

      def model_attributes
        @model_attributes ||= Core::ModelAttributes.new
      end

      def model_methods
        @model_methods ||= Core::Methods.new
      end

      def mailers
        @mailers ||= Core::Mailers.new
      end

      def controllers
        @controllers ||= Core::Controllers.new
      end

      def controller_methods
        @controller_methods ||= Core::Methods.new
      end

      def helpers
        @helpers ||= Core::Helpers.new
      end

      def helper_methods
        @helper_methods ||= Core::Methods.new
      end

      def routes
        @routes ||= Core::Routes.new
      end

      def configs
        @configs ||= Core::Configs.new
      end

      # Clear all prepare objects.
      def clear
        instance_variables.each do |instance_variable|
          instance_variable_set(instance_variable, nil)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_best_practices-1.12.0 lib/rails_best_practices/prepares.rb
rails_best_practices-1.11.1 lib/rails_best_practices/prepares.rb
rails_best_practices-1.11.0 lib/rails_best_practices/prepares.rb
rails_best_practices-1.10.1 lib/rails_best_practices/prepares.rb
rails_best_practices-1.10.0 lib/rails_best_practices/prepares.rb
rails_best_practices-1.9.1 lib/rails_best_practices/prepares.rb