Module: MetaRuby::GUI::HTML
- Defined in:
- lib/metaruby/gui/html.rb,
lib/metaruby/gui/html/page.rb,
lib/metaruby/gui/html/button.rb,
lib/metaruby/gui/html/collection.rb
Overview
Basic functionality to generate HTML pages
The core functionality is in Page
Defined Under Namespace
Classes: Button, Collection, HTMLPage, Page
Constant Summary collapse
- RESSOURCES_DIR =
The directory relative to which ressources (such as css or javascript files) are resolved by default
File.(File.dirname(__FILE__))
Class Method Summary collapse
-
.escape_html(string) ⇒ String
Escape the string to include in HTML.
-
.render_button_bar(buttons) ⇒ String
Render a button bar into HTML.
Class Method Details
.escape_html(string) ⇒ String
Escape the string to include in HTML
16 17 18 19 20 |
# File 'lib/metaruby/gui/html.rb', line 16 def self.escape_html(string) string. gsub('<', '<'). gsub('>', '>') end |
.render_button_bar(buttons) ⇒ String
Render a button bar into HTML
99 100 101 102 103 |
# File 'lib/metaruby/gui/html/button.rb', line 99 def self.() if !.empty? "<div class=\"button_bar\"><span>#{.map(&:render).join(" / ")}</span></div>" end end |