Sha256: eb80a0321711999259b366bbff15fb268d56fdcfe533facacc0fbcc932423cec

Contents?: true

Size: 579 Bytes

Versions: 1

Compression:

Stored size: 579 Bytes

Contents

require 'generators/faat'
require 'rails/generators/base'

module Faat
  module Generators
    class ResourcesGenerator < Base
      argument :resource_name, type: :string, default: 'app', banner: 'resource_name'

      def create_resources
        template "resource_template.rb", "app/resources/#{file_name}_resources.rb"
      end

      private

      def file_name
        resource_name.underscore
      end

      def constant_name
        resource_name.underscore.upcase
      end

      def class_name
        resource_name.downcase.capitalize
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
faat-0.1.3 lib/generators/faat/resources/resources_generator.rb