Class: ValidatorGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/validator/validator_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_validator_filesObject

class_option :validator_type, :type => :string, :aliases => ‘-t’,

:desc => "Validator types. Available options are 'each', 'basic' and 'block'. Default: each"


8
9
10
# File 'lib/generators/validator/validator_generator.rb', line 8

def create_validator_files
  template 'validator.rb', File.join('app/validators', class_path, "#{file_name}_validator.rb")
end