Class: Dill::CheckBox
- Defined in:
- lib/dill/widgets/check_box.rb
Overview
A check box.
Instance Method Summary collapse
-
#get ⇒ Boolean
true
if the checkbox is checked,false
otherwise. -
#set(value) ⇒ Object
Checks or unchecks the current checkbox.
- #to_cell ⇒ Object
- #to_s ⇒ Object
Methods inherited from Field
Methods inherited from Widget
#absent?, action, #classes, #click, #diff, filter, filter?, find_all_in, find_in, #gone?, #has_action?, #id, #initialize, #inspect, #present?, present_in?, root, #root, selector, #text, #value, widget_delegator
Methods included from Widgets::DSL
Methods included from WidgetParts::Container
#has_no_widget?, #has_widget?, #widget, #widgets
Methods included from WidgetParts::Struct
Constructor Details
This class inherits a constructor from Dill::Widget
Instance Method Details
#get ⇒ Boolean
Returns true
if the checkbox is checked, false
otherwise.
13 14 15 |
# File 'lib/dill/widgets/check_box.rb', line 13 def get !! root.checked? end |
#set(value) ⇒ Object
Checks or unchecks the current checkbox.
9 |
# File 'lib/dill/widgets/check_box.rb', line 9 def_delegator :root, :set |
#to_cell ⇒ Object
17 18 19 |
# File 'lib/dill/widgets/check_box.rb', line 17 def to_cell to_s end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/dill/widgets/check_box.rb', line 22 def to_s get ? 'yes' : 'no' end |