Class: Rexslt
- Inherits:
-
Object
- Object
- Rexslt
- Defined in:
- lib/rexslt.rb
Instance Method Summary collapse
-
#initialize(xsl, xml, params = {}) ⇒ Rexslt
constructor
A new instance of Rexslt.
- #to_doc ⇒ Object
- #to_s(options = {}) ⇒ Object (also: #to_xml)
Constructor Details
#initialize(xsl, xml, params = {}) ⇒ Rexslt
Returns a new instance of Rexslt.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rexslt.rb', line 40 def initialize(xsl, xml, params={}) ## debugging variables @rn = 0 @rre = 0 super() @options = {} custom_params = params.inject({}){|r,x| r.merge(Hash[x[0].to_s,x[1]])} xslt_transform(*[xsl, xml].map{|x| RXFHelper.read(x).first}, custom_params) end |
Instance Method Details
#to_doc ⇒ Object
58 |
# File 'lib/rexslt.rb', line 58 def to_doc(); @doc; end |
#to_s(options = {}) ⇒ Object Also known as: to_xml
54 55 56 |
# File 'lib/rexslt.rb', line 54 def to_s(={}) @doc.to_s(@options.merge()).sub('<root>','').sub(/<\/root>$/m,'') end |