Class: Rexslt

Inherits:
Object
  • Object
show all
Defined in:
lib/rexslt.rb

Instance Method Summary collapse

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_docObject



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(options={})
  @doc.to_s(@options.merge(options)).sub('<root>','').sub(/<\/root>$/m,'')
end