Class: MasterView::SimpleRenderHandler
- Inherits:
-
Object
- Object
- MasterView::SimpleRenderHandler
- Defined in:
- lib/masterview/parser.rb
Instance Method Summary collapse
- #cdata(dcs) ⇒ Object
- #characters(dcs) ⇒ Object
- #comment(dcs) ⇒ Object
- #description ⇒ Object
- #etag(dcs) ⇒ Object
- #stag(dcs) ⇒ Object
Instance Method Details
#cdata(dcs) ⇒ Object
142 143 144 145 |
# File 'lib/masterview/parser.rb', line 142 def cdata(dcs) context = dcs.context [] << '<![CDATA[' << context[:content_part] << ']]>' end |
#characters(dcs) ⇒ Object
132 133 134 135 |
# File 'lib/masterview/parser.rb', line 132 def characters(dcs) context = dcs.context [] << context[:content_part] end |
#comment(dcs) ⇒ Object
137 138 139 140 |
# File 'lib/masterview/parser.rb', line 137 def comment(dcs) context = dcs.context [] << '<!-- ' << context[:content_part] << ' -->' end |
#description ⇒ Object
118 119 120 |
# File 'lib/masterview/parser.rb', line 118 def description 'SimpleRenderHandler is the default renderer for nodes, it should be invoked as the last directive and will output node normally' end |
#etag(dcs) ⇒ Object
147 148 149 150 |
# File 'lib/masterview/parser.rb', line 147 def etag(dcs) context = dcs.context [] << '</' << "#{context[:tag].tag_name}>" #must output </ as separate string so simplify_empty_elements can find it end |
#stag(dcs) ⇒ Object
122 123 124 125 126 127 128 129 130 |
# File 'lib/masterview/parser.rb', line 122 def stag(dcs) context = dcs.context ret = [] ret << "<#{context[:tag].tag_name}" context[:tag].attributes.sort.each do |name, value| ret << " #{name}=\"#{value}\"" end ret << '>' #must output as separate string so simplify_empty_elements can find it end |