Class: Alister::HTML::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/html/builder.rb,
lib/html/yard_tags.rb

Overview

An HTML Builder class

Examples:

Creating a simple html

builder = Alister::Builder.new
builder.start do
  doctype
  html lang: "en" do
    head do
      meta charset: "utf-8"
      meta name: "viewport", content: "width=device-width, initial-scale=1"
    end
    body do
      div id: "app"
    end
  end
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBuilder

Returns a new instance of Builder.



39
40
41
# File 'lib/html/builder.rb', line 39

def initialize
  @elements = []
end

Instance Attribute Details

#elementsArray<Element> (readonly)

All the elements that has been collected

Returns:



37
38
39
# File 'lib/html/builder.rb', line 37

def elements
  @elements
end

Instance Method Details

#a(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <a> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <a>



# File 'lib/html/yard_tags.rb', line 118


#abbr(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <abbr> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <abbr>



# File 'lib/html/yard_tags.rb', line 125


#acronym(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <acronym> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <acronym>



# File 'lib/html/yard_tags.rb', line 132


#address(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <address> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <address>



# File 'lib/html/yard_tags.rb', line 139


#applet(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <applet> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <applet>



# File 'lib/html/yard_tags.rb', line 34


#article(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <article> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <article>



# File 'lib/html/yard_tags.rb', line 440


#aside(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <aside> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <aside>



# File 'lib/html/yard_tags.rb', line 447


#audio(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <audio> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <audio>



# File 'lib/html/yard_tags.rb', line 566


#b(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <b> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <b>



# File 'lib/html/yard_tags.rb', line 279


#big(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <big> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <big>



# File 'lib/html/yard_tags.rb', line 146


#blockquote(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <blockquote> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <blockquote>



# File 'lib/html/yard_tags.rb', line 104


#body(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <body> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <body>



# File 'lib/html/yard_tags.rb', line 13


#canvas(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <canvas> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <canvas>



# File 'lib/html/yard_tags.rb', line 454


#caption(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <caption> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <caption>



# File 'lib/html/yard_tags.rb', line 391


#center(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <center> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <center>



# File 'lib/html/yard_tags.rb', line 300


#cite(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <cite> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <cite>



# File 'lib/html/yard_tags.rb', line 153


#code(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <code> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <code>



# File 'lib/html/yard_tags.rb', line 160


#dd(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <dd> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <dd>



# File 'lib/html/yard_tags.rb', line 328


#del(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <del> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <del>



# File 'lib/html/yard_tags.rb', line 167


#details(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <details> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <details>



# File 'lib/html/yard_tags.rb', line 461


#dfn(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <dfn> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <dfn>



# File 'lib/html/yard_tags.rb', line 174


#div(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <div> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <div>



# File 'lib/html/yard_tags.rb', line 20


#dl(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <dl> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <dl>



# File 'lib/html/yard_tags.rb', line 314


#doctypevoid

This method returns an undefined value.

Creates a <!DOCTYPE html> element and puts it to #elements.



71
72
73
# File 'lib/html/builder.rb', line 71

def doctype
  @elements << Element.new(id: Element::DOCTYPE, value: nil)
end

#dt(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <dt> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <dt>



# File 'lib/html/yard_tags.rb', line 321


#em(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <em> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <em>



# File 'lib/html/yard_tags.rb', line 181


#embed(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <embed> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <embed>



# File 'lib/html/yard_tags.rb', line 468


#fieldset(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <fieldset> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <fieldset>



# File 'lib/html/yard_tags.rb', line 356


#figcaption(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <figcaption> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <figcaption>



# File 'lib/html/yard_tags.rb', line 482


#figure(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <figure> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <figure>



# File 'lib/html/yard_tags.rb', line 475


This method returns an undefined value.

Creates a <footer> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <footer>



# File 'lib/html/yard_tags.rb', line 489


#form(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <form> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <form>



# File 'lib/html/yard_tags.rb', line 363


#h1(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <h1> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <h1>



# File 'lib/html/yard_tags.rb', line 55


#h2(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <h2> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <h2>



# File 'lib/html/yard_tags.rb', line 62


#h3(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <h3> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <h3>



# File 'lib/html/yard_tags.rb', line 69


#h4(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <h4> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <h4>



# File 'lib/html/yard_tags.rb', line 76


#h5(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <h5> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <h5>



# File 'lib/html/yard_tags.rb', line 83


#h6(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <h6> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <h6>



# File 'lib/html/yard_tags.rb', line 90


#head(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <head> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <head>



# File 'lib/html/yard_tags.rb', line 587


#header(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <header> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <header>



# File 'lib/html/yard_tags.rb', line 496


#hgroup(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <hgroup> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <hgroup>



# File 'lib/html/yard_tags.rb', line 503


#html(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <html> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <html>



# File 'lib/html/yard_tags.rb', line 6


#i(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <i> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <i>



# File 'lib/html/yard_tags.rb', line 293


#iframe(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <iframe> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <iframe>



# File 'lib/html/yard_tags.rb', line 48


#img(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <img> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <img>



# File 'lib/html/yard_tags.rb', line 188


#ins(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <ins> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <ins>



# File 'lib/html/yard_tags.rb', line 195


#kbd(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <kbd> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <kbd>



# File 'lib/html/yard_tags.rb', line 202


#label(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <label> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <label>



# File 'lib/html/yard_tags.rb', line 370


#legend(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <legend> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <legend>



# File 'lib/html/yard_tags.rb', line 377


#li(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <li> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <li>



# File 'lib/html/yard_tags.rb', line 349


This method returns an undefined value.

Creates a <link> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <link>



# File 'lib/html/yard_tags.rb', line 601


#mark(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <mark> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <mark>



# File 'lib/html/yard_tags.rb', line 559


This method returns an undefined value.

Creates a <menu> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <menu>



# File 'lib/html/yard_tags.rb', line 510


#meta(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <meta> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <meta>



# File 'lib/html/yard_tags.rb', line 307


This method returns an undefined value.

Creates a <nav> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <nav>



# File 'lib/html/yard_tags.rb', line 517


#object(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <object> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <object>



# File 'lib/html/yard_tags.rb', line 41


#ol(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <ol> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <ol>



# File 'lib/html/yard_tags.rb', line 335


#output(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <output> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <output>



# File 'lib/html/yard_tags.rb', line 524


#para(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <p> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <p>



# File 'lib/html/yard_tags.rb', line 97


#partial(element) ⇒ void

This method returns an undefined value.

Adds a partial element and puts it to #elements

Parameters:



78
79
80
81
82
83
84
85
86
87
# File 'lib/html/builder.rb', line 78

def partial(element)
  @elements << element.elements if element.is_a? Builder
  @elements << element if element.is_a?(Element) || element.is_a?(String)

  return unless element.is_a? Array

  element.each do |el|
    partial(el)
  end
end

#pre(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <pre> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <pre>



# File 'lib/html/yard_tags.rb', line 111


#q(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <q> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <q>



# File 'lib/html/yard_tags.rb', line 209


#ruby(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <ruby> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <ruby>



# File 'lib/html/yard_tags.rb', line 531


#s(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <s> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <s>



# File 'lib/html/yard_tags.rb', line 216


#samp(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <samp> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <samp>



# File 'lib/html/yard_tags.rb', line 223


#script(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <script> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <script>



# File 'lib/html/yard_tags.rb', line 580


#section(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <section> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <section>



# File 'lib/html/yard_tags.rb', line 538


#small(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <small> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <small>



# File 'lib/html/yard_tags.rb', line 230


#span(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <span> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <span>



# File 'lib/html/yard_tags.rb', line 27


#start { ... } ⇒ Object

Note:

only use if you’re using Alister::HTML::Builder directly

Yields:

  • Starts an html block



45
46
47
# File 'lib/html/builder.rb', line 45

def start(&block)
  block.call
end

#strike(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <strike> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <strike>



# File 'lib/html/yard_tags.rb', line 237


#strong(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <strong> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <strong>



# File 'lib/html/yard_tags.rb', line 244


#sub(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <sub> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <sub>



# File 'lib/html/yard_tags.rb', line 251


#summary(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <summary> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <summary>



# File 'lib/html/yard_tags.rb', line 545


#sup(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <sup> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <sup>



# File 'lib/html/yard_tags.rb', line 258


#table(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <table> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <table>



# File 'lib/html/yard_tags.rb', line 384


#tbody(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <tbody> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <tbody>



# File 'lib/html/yard_tags.rb', line 398


#td(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <td> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <td>



# File 'lib/html/yard_tags.rb', line 433


#tfoot(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <tfoot> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <tfoot>



# File 'lib/html/yard_tags.rb', line 405


#th(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <th> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <th>



# File 'lib/html/yard_tags.rb', line 426


#thead(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <thead> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <thead>



# File 'lib/html/yard_tags.rb', line 412


#time(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <time> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <time>



# File 'lib/html/yard_tags.rb', line 552


#title(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <title> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <title>



# File 'lib/html/yard_tags.rb', line 594


#to_sString

Combines all elements, and turn it into a single string

Returns:

  • (String)


91
92
93
94
# File 'lib/html/builder.rb', line 91

def to_s
  @elements.flatten!
  @elements.map(&:to_s).join
end

#tr(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <tr> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <tr>



# File 'lib/html/yard_tags.rb', line 419


#tt(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <tt> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <tt>



# File 'lib/html/yard_tags.rb', line 265


#u(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <u> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <u>



# File 'lib/html/yard_tags.rb', line 286


#ul(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <ul> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <ul>



# File 'lib/html/yard_tags.rb', line 342


#var(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <var> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <var>



# File 'lib/html/yard_tags.rb', line 272


#video(value = nil, **args) { ... } ⇒ void

This method returns an undefined value.

Creates a <video> element and puts it to #elements

Parameters:

  • value (String) (defaults to: nil)

    The value of the element

  • args (Hash)

    The attributes of the element

Yields:

  • Create child elements of <video>



# File 'lib/html/yard_tags.rb', line 573