Class: GrapeBootstrap::Commands::Generate
- Defined in:
- lib/grape_bootstrap/commands/generate.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(path, type, options = []) ⇒ Generate
constructor
A new instance of Generate.
- #model(name) ⇒ Object
Constructor Details
#initialize(path, type, options = []) ⇒ Generate
Returns a new instance of Generate.
7 8 9 10 11 12 13 14 15 |
# File 'lib/grape_bootstrap/commands/generate.rb', line 7 def initialize path, type, =[] super path, if type.nil? throw "Type not specified" end @type = type self.send type.downcase, .shift end |
Instance Method Details
#model(name) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/grape_bootstrap/commands/generate.rb', line 17 def model name if name.nil? throw "Model needs a name to be generated" end render_template name end |