Class: Shaf::Generator::Model

Inherits:
Base
  • Object
show all
Defined in:
lib/shaf/generator/model.rb

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

identified_by, identifier, #identifier, inherited, #initialize, usage

Constructor Details

This class inherits a constructor from Shaf::Generator::Base

Class Method Details

.options(parser, options) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/shaf/generator/model.rb', line 8

def self.options(parser, options)
  parser.on("--skip-model", "don't generate model or migration") do |s|
    options[:skip_model] = s
  end

  parser.on("--skip-migration", "don't generate a migration") do |s|
    options[:skip_migration] = s
  end
end

Instance Method Details

#callObject



18
19
20
21
22
23
# File 'lib/shaf/generator/model.rb', line 18

def call
  create_model unless skip_model?
  create_migration unless skip_migration?
  create_serializer
  create_forms
end