Sha256: 7f84002dd10b997079ecfbf96b88dbcb0a27513dc3b1d42a7a6f261266a40685

Contents?: true

Size: 758 Bytes

Versions: 3

Compression:

Stored size: 758 Bytes

Contents

require 'rails/generators/resource_helpers'
require 'generators/resty/base'
module Resty
  module Generators
    class ModelGenerator < Base

      source_root File.expand_path('../../templates', __FILE__)
      
      argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"

      if defined? ::Ixtlan::ModifiedBy
        class_option :modified_by, :type => :boolean
      end
      class_option :timestamps, :type => :boolean, :default => true
      class_option :parent,     :type => :string, :desc => "The parent class for the generated model"

      def create_model_file
        template 'Model.java', File.join(java_root, models_package.gsub(/\./, "/"), class_path, "#{class_name}.java")
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
resty-generators-0.5.3 lib/generators/resty/model/model_generator.rb
resty-generators-0.5.1 lib/generators/resty/model/model_generator.rb
resty-generators-0.5.0 lib/generators/resty/model/model_generator.rb