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.
35 36 37 38 39 |
# File 'lib/rexslt.rb', line 35 def initialize(xsl, xml, params={}) super() 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
45 |
# File 'lib/rexslt.rb', line 45 def to_doc(); @doc; end |
#to_s(options = {}) ⇒ Object Also known as: to_xml
41 42 43 |
# File 'lib/rexslt.rb', line 41 def to_s(={}) @doc.to_s().sub('<root>','').sub(/<\/root>$/m,'') end |