Sha256: aabd5443585cb26f1c29be6466055088c3838ad07852e1f1dd6b12eeefa871ee

Contents?: true

Size: 1.28 KB

Versions: 7

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require_rel 'prepares'

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

      def gems
        @gems ||= Core::Gems.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

7 entries across 7 versions & 1 rubygems

Version Path
rails_best_practices-1.23.2 lib/rails_best_practices/prepares.rb
rails_best_practices-1.23.1 lib/rails_best_practices/prepares.rb
rails_best_practices-1.23.0 lib/rails_best_practices/prepares.rb
rails_best_practices-1.22.1 lib/rails_best_practices/prepares.rb
rails_best_practices-1.22.0 lib/rails_best_practices/prepares.rb
rails_best_practices-1.21.0 lib/rails_best_practices/prepares.rb
rails_best_practices-1.20.1 lib/rails_best_practices/prepares.rb