Class: Yuzu::Generators::Generator
- Defined in:
- lib/yuzu/generators/base.rb
Overview
Generators are like filters but they have the ability to produce new files and folders in the website tree.
Direct Known Subclasses
Constant Summary collapse
- @@generators =
{}
Instance Attribute Summary collapse
-
#directive ⇒ Object
readonly
Returns the value of attribute directive.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#generate!(website_obj) ⇒ Object
generate!() is called on the first pass by a visitor in the siteroot.
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
- #should_generate?(website_file) ⇒ Boolean
- #visitor_filter ⇒ Object
Constructor Details
#initialize ⇒ Generator
Returns a new instance of Generator.
20 21 22 23 |
# File 'lib/yuzu/generators/base.rb', line 20 def initialize @name = :generator @directive = "GENERATOR" end |
Instance Attribute Details
#directive ⇒ Object (readonly)
Returns the value of attribute directive.
18 19 20 |
# File 'lib/yuzu/generators/base.rb', line 18 def directive @directive end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'lib/yuzu/generators/base.rb', line 18 def name @name end |
Class Method Details
.generators ⇒ Object
14 15 16 |
# File 'lib/yuzu/generators/base.rb', line 14 def self.generators @@generators end |
.registry ⇒ Object
11 12 13 |
# File 'lib/yuzu/generators/base.rb', line 11 def self.registry :generators end |
Instance Method Details
#generate!(website_obj) ⇒ Object
generate!() is called on the first pass by a visitor in the siteroot.
36 37 38 |
# File 'lib/yuzu/generators/base.rb', line 36 def generate!(website_obj) # Produce new children and add them to the tree, if necessary. end |
#should_generate?(website_file) ⇒ Boolean
25 26 27 |
# File 'lib/yuzu/generators/base.rb', line 25 def should_generate?(website_file) false end |
#visitor_filter ⇒ Object
29 30 31 |
# File 'lib/yuzu/generators/base.rb', line 29 def visitor_filter proc {|c| true} end |