Sha256: 06f473d470ce61f34a5ae8ba00f1f27f111bc4aadab8c545cfe390033787e32e
Contents?: true
Size: 711 Bytes
Versions: 14
Compression:
Stored size: 711 Bytes
Contents
require 'rails/generators' module Enjoy::Catalog::Models class ItemGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) argument :class_name, type: :string desc 'Enjoy::Catalog Item Model generator' def item template 'item.erb', "app/models/#{file_name}.rb" end private def capitalized_class_name class_name.capitalize end def camelcased_class_name class_name.camelcase end def file_name underscored_class_name end def underscored_class_name camelcased_class_name.underscore end def underscored_pluralized_class_name underscored_class_name.pluralize end end end
Version data entries
14 entries across 14 versions & 1 rubygems