Sha256: 6f06ff61393a06a829543e8799ffcd05dcbd2d8389663d0d9bccc9f3cd93f81f

Contents?: true

Size: 579 Bytes

Versions: 1

Compression:

Stored size: 579 Bytes

Contents

class ScaffoldGenerator
  
  attr_accessor :attributes, :model
  
  def initialize(args)
  	@model = args.delete_at(0).downcase 
  	parse_attributes(args)
  end
  
  def build
  	ModelGenerator.new(model, attributes).build
  	ControllerGenerator.new(model, @attributes).build
  	FreemarkerGenerator.new(model, @attributes).build
  end
  
  private 
    def parse_attributes(args)
      @attributes = []
      args.each do |arg|
        parsedAttribute = arg.split(":")
        @attributes << Attribute.new(parsedAttribute[0], parsedAttribute[1].capitalize)
      end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vraptor-scaffold-0.0.1.beta2 lib/generators/scaffold_generator/scaffold_generator.rb