Class: Ptero::Generator::LoadAllGenerator

Inherits:
PHPGenerator show all
Defined in:
lib/ptero/generators/loadallgenerator.rb

Overview

Generator for the loadall.php file that is tasked with running all other PHP files in its directory

Instance Attribute Summary collapse

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(path, *priorities) ⇒ LoadAllGenerator

Send the directory in which to generate as a parameter, as well as the names of files that need to be loaded first

Parameters:

  • path (String)

    the path to the file that will be generated

  • priorities (Array)

    all files that need to be required first, in order of priority



16
17
18
19
20
21
# File 'lib/ptero/generators/loadallgenerator.rb', line 16

def initialize(path,*priorities)
  super 'loadall'
  # Stuff to load first, should be an array
  @path = Pathname.new(path)
  @priorities = priorities
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



23
24
25
# File 'lib/ptero/generators/loadallgenerator.rb', line 23

def path
  @path
end

#prioritiesObject (readonly)

Returns the value of attribute priorities.



23
24
25
# File 'lib/ptero/generators/loadallgenerator.rb', line 23

def priorities
  @priorities
end