Class: HtmlCom::Accordion

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, debug: false) ⇒ Accordion

Returns a new instance of Accordion.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/htmlcom.rb', line 19

def initialize(xml, debug: false)
  
  xml, @debug = xml, debug
  
  # transform the accordion XML to tags XML
  tags = Nokogiri::XSLT(xsl()).transform(Nokogiri::XML(xml))\
      .to_xhtml(indent: 0)
  jmb = JsMenuBuilder.new(tags, debug: debug)

  # apply the AJAX      
  @to_html = JsAjaxWizard.new(jmb.to_webpage).to_html      

end

Instance Attribute Details

#to_htmlObject (readonly)

Returns the value of attribute to_html.



17
18
19
# File 'lib/htmlcom.rb', line 17

def to_html
  @to_html
end