Class: SLinkWidget
- Inherits:
-
Cuca::Widget
- Object
- Cuca::Widget
- SLinkWidget
- Defined in:
- lib/cuca/stdlib/slink.rb
Overview
Simple, fast link - no markaby as block
Example:
mab { SLink('http://cuca.rubyforge.net', 'click') }
Instance Method Summary collapse
Methods inherited from Cuca::Widget
#app, #cgi, #clear, clear_hints, #content, #content=, #controller, define_attr_method, #escape, #escapeHTML, #get_assigns, #hints, #initialize, #log, #params, #query_parameters, #request_method, #request_parameters, run_attr_method, #session, #to_s, #unescape, #unescapeHTML
Constructor Details
This class inherits a constructor from Cuca::Widget
Instance Method Details
#output(target, text = nil, params = {}, tag_attrib = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cuca/stdlib/slink.rb', line 22 def output(target, text = nil, params = {}, tag_attrib = {}) @attribs = tag_attrib @attribs[:href] = build_href(target, params) @_content = "<a " @attribs.each_pair do |k,v| @_content << "#{k}='#{v}'" end @_content << ">#{text || target}</a>" end |