Class: Ptero::Generator::PHPClassGenerator
- Inherits:
-
PHPGenerator
- Object
- Ptero::Generator
- PHPGenerator
- Ptero::Generator::PHPClassGenerator
- Defined in:
- lib/ptero/generators/phpclassgenerator.rb
Overview
A generator for PHP classes
Direct Known Subclasses
Constant Summary
Constants inherited from Ptero::Generator
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Attributes inherited from Ptero::Generator
Instance Method Summary collapse
-
#initialize(name, parent = nil) ⇒ PHPClassGenerator
constructor
A new instance of PHPClassGenerator.
Methods inherited from PHPGenerator
Methods inherited from Ptero::Generator
const_missing, #content, #content_params, #extension, #filename, #generate, #generated?, #location, #path, #reload, #remove, #template_path, #to_s, #type
Constructor Details
#initialize(name, parent = nil) ⇒ PHPClassGenerator
Returns a new instance of PHPClassGenerator.
15 16 17 18 19 |
# File 'lib/ptero/generators/phpclassgenerator.rb', line 15 def initialize(name,parent=nil) # Capitalize class names super("#{name[0].upcase}#{name[1,name.length-1]}") @parent = "#{parent[0].upcase}#{parent[1,parent.length-1]}"if parent end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
21 22 23 |
# File 'lib/ptero/generators/phpclassgenerator.rb', line 21 def parent @parent end |