Module: HtmlTag

Extended by:
HtmlTag
Included in:
HtmlTag
Defined in:
lib/html-tag/inbound.rb,
lib/html-tag/html_tag.rb,
lib/html-tag/outbound.rb

Overview

HtmlTag do

form do
  input name: q
end

end

Defined Under Namespace

Classes: Inbound, Outbound

Constant Summary collapse

OPTS =
{
  format: false
}

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(tag_name, *args, &block) ⇒ Object

forward to class only if



31
32
33
34
35
36
37
# File 'lib/html-tag/html_tag.rb', line 31

def method_missing tag_name, *args, &block
  if self === HtmlTag
    Outbound.tag(tag_name, args[0], args[1], &block)
  else
    super
  end
end

Instance Method Details

#tag(*args, &block) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/html-tag/html_tag.rb', line 22

def tag *args, &block
  if block
    HtmlTag *args, &block
  else
    ::HtmlTag::Outbound
  end
end