Class: ObjectView::Button

Inherits:
Element
  • Object
show all
Defined in:
lib/object_view/input.rb

Instance Attribute Summary

Attributes inherited from Element

#acceptable_children, #children, #single_line, #tag

Instance Method Summary collapse

Methods inherited from Element

#<<, #add, #add_with_tag, #attr, #attributes, #css_class=, #find_element_with_tag, #id=, #is_acceptable_child?, #on_click=, #render, #render_attributes, #render_children, #style, #style=

Constructor Details

#initialize(text = nil, name = nil) ⇒ Button

Returns a new instance of Button.



190
191
192
193
194
195
196
197
# File 'lib/object_view/input.rb', line 190

def initialize(text = nil, name = nil)
  super(text)
  @tag = 'button'
  self.attr('type', 'submit')
  if (name != nil)
    self.attr('name', name)
  end
end

Instance Method Details

#label=(text) ⇒ Object



199
200
201
# File 'lib/object_view/input.rb', line 199

def label= text
  self.add text
end