Sha256: 9ccec85d9b5fdb7659748493256a4b4a14726d67588d25f2c7ec575925243f2b

Contents?: true

Size: 536 Bytes

Versions: 5

Compression:

Stored size: 536 Bytes

Contents

module Rails
  module Generators
    class ParserGenerator < NamedBase
      source_root File.expand_path('../templates', __FILE__)
      check_class_collision :suffix => 'Parser'

      class_option :parent, :type => :string, :desc => 'The parent class for the generated parser'

      def create_parser_file
        template 'parser.rb.erb', File.join('app/decanter/parsers', class_path, "#{file_name}_parser.rb")
      end

      private

      def parent_class_name
        'Decanter::ValueParser::Base'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decanter-0.6.3 lib/generators/rails/parser_generator.rb
decanter-0.6.2 lib/generators/rails/parser_generator.rb
decanter-0.6.1 lib/generators/rails/parser_generator.rb
decanter-0.6.0 lib/generators/rails/parser_generator.rb
decanter-0.5.5 lib/generators/rails/parser_generator.rb