Class: Gretel::Renderer::NonSemanticRenderer
- Defined in:
- lib/gretel/renderer.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #render_container(html) ⇒ Object
- #render_fragment_tag(fragment_tag, text, url, position, options = {}) ⇒ Object
Methods inherited from Base
#initialize, #render_current_fragment, #render_fragment, #render_posttext, #render_pretext
Constructor Details
This class inherits a constructor from Gretel::Renderer::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gretel::Renderer::Base
Instance Method Details
#render_container(html) ⇒ Object
308 309 310 |
# File 'lib/gretel/renderer.rb', line 308 def render_container(html) content_tag([:container_tag], html, id: [:id], class: [:class]) end |
#render_fragment_tag(fragment_tag, text, url, position, options = {}) ⇒ Object
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/gretel/renderer.rb', line 289 def render_fragment_tag(fragment_tag, text, url, position, = {}) fragment_class = join_classes([:fragment_class], [:class]) if fragment_tag if url.present? text = (text, url, "aria-current": [:aria_current], data: [:link_data]) content_tag(fragment_tag, text, class: fragment_class) else content_tag(fragment_tag, text, class: fragment_class, "aria-current": [:aria_current], data: [:link_data]) end elsif url.present? (text, url, class: join_classes(fragment_class, [:link_class]), "aria-current": [:aria_current], data: [:link_data]) elsif [:class].present? content_tag(:span, text, class: fragment_class, "aria-current": [:aria_current]) else text end end |