Sha256: 09273ec83204b21972ee4e3bde4ff10a372d6d4324f981433edb4308a870f261

Contents?: true

Size: 763 Bytes

Versions: 5

Compression:

Stored size: 763 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_base_package.gsub(/\./, "/"), class_path, "#{class_name}.java")
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
resty-generators-0.4.0 lib/generators/resty/model/model_generator.rb
resty-generators-0.3.3 lib/generators/resty/model/model_generator.rb
resty-generators-0.3.2 lib/generators/resty/model/model_generator.rb
resty-generators-0.3.1 lib/generators/resty/model/model_generator.rb
resty-generators-0.3.0 lib/generators/resty/model/model_generator.rb