Sha256: 26960e7ce181569e43e20094d4edbb8b9b942c5a4d2983213cd4e62efdf15c3f

Contents?: true

Size: 473 Bytes

Versions: 4

Compression:

Stored size: 473 Bytes

Contents

require 'rails/generators'

module Indexers
  module Generators
    class IndexerGenerator < Rails::Generators::NamedBase

      source_root File.expand_path('../templates', __FILE__)

      def create_index_file
        template 'indexer.rb', File.join('app/indexers', class_path, "#{file_name}_indexer.rb")
      end

      private

      def class_name_option
        if class_path.any?
          ", class_name: '#{class_name}'"
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
indexers-5.1.1 lib/generators/indexers/indexer/indexer_generator.rb
indexers-5.1.0 lib/generators/indexers/indexer/indexer_generator.rb
indexers-4.1.0.1 lib/generators/indexers/indexer/indexer_generator.rb
indexers-4.1.0.0 lib/generators/indexers/indexer/indexer_generator.rb