Class: Hypertext::DSL

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

Constant Summary collapse

TAGS =
[:a, :abbr, :address, :area, :article, :aside,
:audio, :b, :base, :bdi, :bdo, :blockquote, :body, :br,
:button, :canvas, :caption, :cite, :code, :col, :colgroup,
:data, :datalist, :dd, :del, :details, :dfn, :dialog, :div,
:dl, :dt, :em, :embed, :fieldset, :figcaption, :figure,
:footer, :form, :h1, :h2, :h3, :h4, :h5, :h6, :head,
:header, :hgroup, :hr, :html, :i, :iframe, :img, :input,
:ins, :kbd, :label, :legend, :li, :link, :main, :map,
:mark, :meta, :meter, :nav, :noscript, :object, :ol,
:optgroup, :option, :output, :p, :param, :picture, :pre,
:progress, :q, :rb, :rp, :rt, :rtc, :ruby, :s, :samp,
:script, :section, :select, :slot, :small, :source, :span,
:strong, :style, :sub, :summary, :sup, :table, :tbody, :td,
:template, :textarea, :tfoot, :th, :thead, :time, :title,
:tr, :track, :u, :ul, :var, :video, :wbr]

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ DSL

Returns a new instance of DSL.



41
42
43
44
# File 'lib/hypertext/dsl.rb', line 41

def initialize(&block)
  @ht = Hypertext.new
  instance_eval(&block)
end

Instance Method Details

#append(content) ⇒ Object



52
53
54
# File 'lib/hypertext/dsl.rb', line 52

def append(content)
  @ht.append(content)
end

#text(content) ⇒ Object



56
57
58
# File 'lib/hypertext/dsl.rb', line 56

def text(content)
  @ht.text(content)
end

#to_aObject



60
61
62
# File 'lib/hypertext/dsl.rb', line 60

def to_a
  @ht.to_a
end

#to_sObject



64
65
66
# File 'lib/hypertext/dsl.rb', line 64

def to_s
  @ht.to_s
end