Class: Rhb::Builder
- Inherits:
-
Object
show all
- Defined in:
- lib/rhb/builder.rb
Constant Summary
collapse
- VOID_ELEMENTS =
%w{area base br col command embed hr img input
keygen link meta param source track wbr}.freeze
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Builder.
8
9
10
|
# File 'lib/rhb/builder.rb', line 8
def initialize
@buffer = ''
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
62
63
64
65
|
# File 'lib/rhb/builder.rb', line 62
def method_missing name, *args, &block
cache_element name
public_send name, *args, &block
end
|
Instance Method Details
#doctype ⇒ Object
17
18
19
|
# File 'lib/rhb/builder.rb', line 17
def doctype
@buffer << '<!DOCTYPE html>'
end
|
#to_s ⇒ Object
Also known as:
to_html
12
13
14
|
# File 'lib/rhb/builder.rb', line 12
def to_s
@buffer
end
|