Class: Alula::Generator
- Inherits:
-
Object
show all
- Defined in:
- lib/alula/generator.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options, opts) ⇒ Generator
Returns a new instance of Generator.
29
30
31
32
|
# File 'lib/alula/generator.rb', line 29
def initialize(options, opts)
@options = options
@site = opts.delete(:site)
end
|
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
10
11
12
|
# File 'lib/alula/generator.rb', line 10
def options
@options
end
|
#site ⇒ Object
Returns the value of attribute site.
11
12
13
|
# File 'lib/alula/generator.rb', line 11
def site
@site
end
|
Class Method Details
.generators ⇒ Object
7
|
# File 'lib/alula/generator.rb', line 7
def self.generators; @@generators ||= {}; end
|
.load(opts) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/alula/generator.rb', line 13
def self.load(opts)
name = opts.delete(:type).to_s
options = opts.delete(:options)
if generators[name] and !(!!options == options and !options)
generator = generators[name]
return generator.new(options, opts)
end
end
|
.register(name, klass) ⇒ Object
autoload :Paginate, ‘alula/generators/paginate’ autoload :FeedBuilder, ‘alula/generators/feedbuilder’ autoload :Sitemap, ‘alula/generators/sitemap’
6
|
# File 'lib/alula/generator.rb', line 6
def self.register(name, klass); generators[name.to_s] = klass; end
|
Instance Method Details
#allow_compressing? ⇒ Boolean
38
39
40
|
# File 'lib/alula/generator.rb', line 38
def allow_compressing?
:high
end
|
#generators ⇒ Object
8
|
# File 'lib/alula/generator.rb', line 8
def generators; self.class.generators; end
|
#substitutes(locale, item) ⇒ Object
34
35
36
|
# File 'lib/alula/generator.rb', line 34
def substitutes(locale, item)
{}
end
|