Class: GrapeBootstrap::Commands::Generate

Inherits:
Base
  • Object
show all
Defined in:
lib/grape_bootstrap/commands/generate.rb

Instance Attribute Summary

Attributes inherited from Base

#path

Instance Method Summary collapse

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, options=[]
  super path, options
  if type.nil?
    throw "Type not specified"
  end
  @type = type

  self.send type.downcase, options.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