Sha256: 0a3c27f0b2777b6e727caa7272d33a36f2ec3e5fa80dc56638f7148bc79e2a47
Contents?: true
Size: 841 Bytes
Versions: 34
Compression:
Stored size: 841 Bytes
Contents
module JsonVoorhees class EngineCreateModelGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) argument :module_name, :type => :string argument :resource_name, :type => :string argument :api_version, :type => :string, :default => "1" argument :attributes, type: :array, default: [], banner: "field:type field:type" def sprint template "model.rb", "app/models/#{module_snake}/v#{api_version}/#{resource_singular}.rb" end private def resource_singular resource_name.underscore.singularize end def resource_plural resource_name.underscore.pluralize end def resource_camel resource_name.camelize.singularize end def module_camel module_name.camelize end def module_snake module_name.underscore.downcase end end end
Version data entries
34 entries across 34 versions & 1 rubygems