Class: Aurita::GUI::Submit_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 :submit. Block argument will be used as button label (:value) Example:

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

Instance Attribute Summary

Attributes inherited from Button

#icon

Attributes inherited from Element

#attrib, #force_closing_tag, #gui_element_id, #parent, #tag

Instance Method Summary collapse

Methods inherited from Button

#content

Methods inherited from Element

#+, #<<, #[], #[]=, #add_class, #aurita_gui_element, #clear_floating, #css_classes, #find_by_dom_id, #get_content, #has_content?, #id, #id=, #inspect, #js_init_code, #length, #method_missing, #recurse, #remove_class, #set_content, #string, #swap, #to_ary, #touch, #touched?, #type=, #untouch

Methods included from Marshal_Helper_Class_Methods

#marshal_load

Methods included from Marshal_Helper

#marshal_dump

Constructor Details

#initialize(params, &block) ⇒ Submit_Button

Returns a new instance of Submit_Button.



54
55
56
57
58
59
60
61
# File 'lib/aurita-gui/button.rb', line 54

def initialize(params, &block)
  params[:tag]  = :input
  params[:type] = :submit 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