Class: HtmlCom::Accordion
- Inherits:
-
Object
- Object
- HtmlCom::Accordion
- Defined in:
- lib/htmlcom.rb
Instance Attribute Summary collapse
-
#to_css ⇒ Object
readonly
Returns the value of attribute to_css.
-
#to_html ⇒ Object
readonly
Returns the value of attribute to_html.
-
#to_js ⇒ Object
readonly
Returns the value of attribute to_js.
-
#to_tags ⇒ Object
readonly
Returns the value of attribute to_tags.
Instance Method Summary collapse
-
#initialize(xml, debug: false) ⇒ Accordion
constructor
A new instance of Accordion.
Constructor Details
#initialize(xml, debug: false) ⇒ Accordion
Returns a new instance of Accordion.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/htmlcom.rb', line 20 def initialize(xml, debug: false) xml, @debug = xml, debug # transform the accordion XML to tags XML = Nokogiri::XSLT(xsl()).transform(Nokogiri::XML(xml))\ .to_xhtml(indent: 0) @to_tags = # used for debugging the structure jmb = JsMenuBuilder.new(, debug: debug) pg = if Rexle.new(xml).root.attributes[:navbar] then a = jmb.to_h.keys.sort.map {|key, _| [key, '#' + key.downcase]} = JsMenuBuilder.new(:sticky_navbar, {sticky_navbar: a, debug: debug}) @to_css = .to_css + "\n" + jmb.to_css @to_js = .to_js + "\n" + jmb.to_js jmb.to_webpage do |css, html, js| [ .to_css + "\n" + css, .to_html + "\n" + html, .to_js + "\n" + js ] end else @to_css = jmb.to_css @to_js = jmb.to_js jmb.to_webpage end # apply the AJAX @to_html = JsAjaxWizard.new(pg).to_html end |
Instance Attribute Details
#to_css ⇒ Object (readonly)
Returns the value of attribute to_css.
18 19 20 |
# File 'lib/htmlcom.rb', line 18 def to_css @to_css end |
#to_html ⇒ Object (readonly)
Returns the value of attribute to_html.
18 19 20 |
# File 'lib/htmlcom.rb', line 18 def to_html @to_html end |
#to_js ⇒ Object (readonly)
Returns the value of attribute to_js.
18 19 20 |
# File 'lib/htmlcom.rb', line 18 def to_js @to_js end |
#to_tags ⇒ Object (readonly)
Returns the value of attribute to_tags.
18 19 20 |
# File 'lib/htmlcom.rb', line 18 def @to_tags end |