Class: Wee::Brush::AnchorTag

Inherits:
GenericTagBrush show all
Defined in:
lib/wee/renderer/html/brushes.rb

Instance Attribute Summary

Attributes inherited from Wee::Brush

#canvas, #parent

Instance Method Summary collapse

Methods inherited from GenericTagBrush

#__action_callback, #__actionurl_callback, #__actionurl_named_callback, #__input_callback, #css_class, #css_class_for, #method_missing, #onclick_callback, #onclick_update, #with

Methods inherited from Wee::Brush

#close, #with

Constructor Details

#initializeAnchorTag

Returns a new instance of AnchorTag.



571
572
573
# File 'lib/wee/renderer/html/brushes.rb', line 571

def initialize
  super('a')
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Wee::Brush::GenericTagBrush

Instance Method Details

#callback(symbol = nil, *args, &block) ⇒ Object



586
587
588
589
590
591
592
# File 'lib/wee/renderer/html/brushes.rb', line 586

def callback(symbol=nil, *args, &block)
  if @info
    __set_url(@canvas.url_for_callback(to_callback(symbol, args, block), :action, :info => @info))
  else
    __set_url(@canvas.url_for_callback(to_callback(symbol, args, block)))
  end
end

#info(info = nil) ⇒ Object



581
582
583
584
# File 'lib/wee/renderer/html/brushes.rb', line 581

def info(info=nil)
  @info = info
  self
end

#named_callback(name, symbol = nil, *args, &block) ⇒ Object



594
595
596
597
598
599
600
# File 'lib/wee/renderer/html/brushes.rb', line 594

def named_callback(name, symbol=nil, *args, &block)
  if @info
    __set_url(@canvas.url_for_named_callback(name, to_callback(symbol, args, block), :info => @info))
  else
    __set_url(@canvas.url_for_named_callback(name, to_callback(symbol, args, block)))
  end
end