Class: Ptero::Generator::ControllerGenerator

Inherits:
PHPClassGenerator show all
Defined in:
lib/ptero/generators/controllergenerator.rb

Overview

controllergenerator.rb

generate Dinosaur controller objects

Instance Attribute Summary

Attributes inherited from PHPClassGenerator

#parent

Attributes inherited from Ptero::Generator

#app, #dir, #name

Instance Method Summary collapse

Methods inherited from PHPGenerator

#extension

Methods inherited from Ptero::Generator

const_missing, #content, #content_params, #extension, #filename, #generate, #generated?, #location, #reload, #remove, #template_path, #to_s, #type

Constructor Details

#initialize(name, parent = 'Application') ⇒ ControllerGenerator

Returns a new instance of ControllerGenerator.

Parameters:

  • name (String)

    the name of the controller

  • parent (String) (defaults to: 'Application')

    the name of the controller’s parent



12
13
14
# File 'lib/ptero/generators/controllergenerator.rb', line 12

def initialize(name,parent='Application')
  super("#{name}Controller","#{parent}Controller")
end

Instance Method Details

#pathString

Returns superclass_path/controllers.

Returns:

  • (String)

    superclass_path/controllers



17
18
19
# File 'lib/ptero/generators/controllergenerator.rb', line 17

def path
  "#{super}/controllers"
end