Class: ValidatorGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ValidatorGenerator
- Defined in:
- lib/generators/validator/validator_generator.rb
Instance Method Summary collapse
-
#create_validator_files ⇒ Object
class_option :validator_type, :type => :string, :aliases => ‘-t’, :desc => “Validator types.
Instance Method Details
#create_validator_files ⇒ Object
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 |