Class: Alula::Generator
- Inherits:
-
Object
- Object
- Alula::Generator
- Defined in:
- lib/alula/generator.rb
Direct Known Subclasses
Defined Under Namespace
Classes: FeedBuilder, Paginate, Sitemap
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options, opts) ⇒ Generator
constructor
A new instance of Generator.
- #substitutes(locale, item) ⇒ Object
Constructor Details
#initialize(options, opts) ⇒ Generator
Returns a new instance of Generator.
22 23 24 25 |
# File 'lib/alula/generator.rb', line 22 def initialize(, opts) @options = @site = opts.delete(:site) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/alula/generator.rb', line 7 def @options end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
8 9 10 |
# File 'lib/alula/generator.rb', line 8 def site @site end |
Class Method Details
.load(opts) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/alula/generator.rb', line 10 def self.load(opts) type = opts.delete(:type) = opts.delete(:options) # Try to find our generator cls_name = self.constants.select {|t| t.to_s.downcase == type.downcase}.first if cls_name cls = self.const_get(cls_name) gen = cls.new(, opts) end end |
Instance Method Details
#substitutes(locale, item) ⇒ Object
27 28 29 |
# File 'lib/alula/generator.rb', line 27 def substitutes(locale, item) {} end |