Class: Ptero::Generator::ViewGenerator

Inherits:
TwigGenerator show all
Defined in:
lib/ptero/generators/viewgenerator.rb

Overview

Generator for a view that extends a layout

Direct Known Subclasses

PageGenerator, PageNotFoundGenerator

Instance Attribute Summary collapse

Attributes inherited from Ptero::Generator

#app, #dir, #name

Instance Method Summary collapse

Methods inherited from TwigGenerator

#extension, #path

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 = 'application') ⇒ ViewGenerator

Returns a new instance of ViewGenerator.

Parameters:

  • name (String)

    the name of the view

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

    the name of the layout to extend



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

def initialize(name,parent='application')
  super(name)
  @parent = parent
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent.



22
23
24
# File 'lib/ptero/generators/viewgenerator.rb', line 22

def parent
  @parent
end