Class: Aurita::GUI::HTML
- Inherits:
-
Object
- Object
- Aurita::GUI::HTML
- Defined in:
- lib/aurita-gui/html.rb,
lib/aurita-gui/javascript.rb
Overview
class
Class Method Summary collapse
-
.br ⇒ Object
Statically defined as <br /> must not have any attributes.
- .build(&block) ⇒ Object
- .js(&block) ⇒ Object
- .method_missing(meth_name, *attribs, &block) ⇒ Object
-
.p(*attribs, &block) ⇒ Object
p is defined in Kernel, so we have to redirect it manually (method_missing won’t be triggered for it).
- .puts(arg) ⇒ Object
- .render(meth_name, *args, &block) ⇒ Object
Class Method Details
.br ⇒ Object
Statically defined as <br /> must not have any attributes.
285 286 287 |
# File 'lib/aurita-gui/html.rb', line 285 def self.br Element.new(:tag => :br) end |
.build(&block) ⇒ Object
296 297 298 299 |
# File 'lib/aurita-gui/html.rb', line 296 def self.build(&block) raise ::Exception.new('Missing block for HTML.render') unless block_given? Element.new(:tag => :pseudo) { self.class_eval(&block) } end |
.js(&block) ⇒ Object
158 159 160 161 162 163 164 |
# File 'lib/aurita-gui/javascript.rb', line 158 def self.js(&block) if block_given? then Javascript.build(&block) else Javascript end end |
.method_missing(meth_name, *attribs, &block) ⇒ Object
308 309 310 |
# File 'lib/aurita-gui/html.rb', line 308 def self.method_missing(meth_name, *attribs, &block) render(meth_name, *attribs, &block) end |
.p(*attribs, &block) ⇒ Object
p is defined in Kernel, so we have to redirect it manually (method_missing won’t be triggered for it)
304 305 306 |
# File 'lib/aurita-gui/html.rb', line 304 def self.p(*attribs, &block) render(:p, *attribs, &block) end |