Class: Xomponent::Document
- Inherits:
-
Object
- Object
- Xomponent::Document
- Defined in:
- lib/Xomponent/Document.rb
Constant Summary collapse
- DOCTYPE =
'<!DOCTYPE html>'
Instance Attribute Summary collapse
-
#head_inner ⇒ Object
writeonly
Sets the attribute head_inner.
-
#script_content ⇒ Object
writeonly
Sets the attribute script_content.
-
#style_content ⇒ Object
writeonly
Sets the attribute style_content.
-
#title_content ⇒ Object
writeonly
Sets the attribute title_content.
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#head_inner=(value) ⇒ Object (writeonly)
Sets the attribute head_inner
5 6 7 |
# File 'lib/Xomponent/Document.rb', line 5 def head_inner=(value) @head_inner = value end |
#script_content=(value) ⇒ Object (writeonly)
Sets the attribute script_content
5 6 7 |
# File 'lib/Xomponent/Document.rb', line 5 def script_content=(value) @script_content = value end |
#style_content=(value) ⇒ Object (writeonly)
Sets the attribute style_content
5 6 7 |
# File 'lib/Xomponent/Document.rb', line 5 def style_content=(value) @style_content = value end |
#title_content=(value) ⇒ Object (writeonly)
Sets the attribute title_content
5 6 7 |
# File 'lib/Xomponent/Document.rb', line 5 def title_content=(value) @title_content = value end |
Instance Method Details
#head_content ⇒ Object
12 13 14 15 |
# File 'lib/Xomponent/Document.rb', line 12 def head_content title { @title_content } + style { @style_content } + (@head_inner || '') end |
#render ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/Xomponent/Document.rb', line 17 def render DOCTYPE + html { head { head_content } + body { div(id: :app) + script { @script_content } } } end |