Class: Aurita::GUI::Reset_Button

Inherits:
Button show all
Defined in:
lib/aurita-gui/button.rb

Overview

Specialization of Aurita::GUI::Element for submit buttons. Set @tag to :input, @type to :reset. Block argument will be used as button label (:value) Example:

b = Reset_Button.new(:class => :css_class) { 'click me' }

Note that reset buttons in forms are considered bad style in terms of usability.

Instance Attribute Summary

Attributes inherited from Button

#icon

Attributes inherited from Element

#attrib, #force_closing_tag, #parent, #tag

Instance Method Summary collapse

Methods inherited from Button

#content

Methods inherited from Element

#+, #<<, #[], #[]=, #add_class, #clear_floating, #css_classes, #find_by_dom_id, #get_content, #has_content?, #id, #id=, #method_missing, #recurse, #remove_class, #set_content, #string, #swap, #to_ary, #type=

Methods included from Marshal_Helper_Class_Methods

#marshal_load

Methods included from Marshal_Helper

#marshal_dump

Constructor Details

#initialize(params, &block) ⇒ Reset_Button

Returns a new instance of Reset_Button.



74
75
76
77
78
79
80
81
# File 'lib/aurita-gui/button.rb', line 74

def initialize(params, &block)
  params[:tag]  = :input
  params[:type] = :reset unless params[:type]
  if block_given? then
    params[:value] = yield
  end
  super(params)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aurita::GUI::Element