Class: ESS::Maker
- Inherits:
-
Object
- Object
- ESS::Maker
- Defined in:
- lib/ess/maker.rb
Class Method Summary collapse
-
.make(options = {}, &block) ⇒ Object
Create a new ESS document.
Class Method Details
.make(options = {}, &block) ⇒ Object
Create a new ESS document. See README for examples on how it should be used.
Yields
- ESS::ESS
-
object representing the “ess” root tag of an ESS document
Options
Currently, the following options are defined:
:push
Whether to push the resulting document to aggregators before returning from the method. Default is false.
:validate
Validate resulting document before returning from the method. Default is true.
:version
Set a different value for the “version” attribute of the “ess” tag. Default is “0.9”.
:lang
Set a value for the “lang” attribute of the “ess” tag. Default is “en”.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ess/maker.rb', line 35 def self.make ={}, &block = DEFAULT_OPTIONS.merge ess = ESS.new ess.xmlns_attr "http://essfeed.org/history/#{[:version]}" ess.version_attr [:version] ess.lang_attr [:lang] block.call(ess) if block ess.channel.generator.text!("ess:ruby:generator:version:#{[:version]}") if ess.channel.generator.text! == "" ess.validate if [:validate] ess.push_to_aggregators() if [:push] || [:aggregators] return ess end |