Class: Dill::CheckBox

Inherits:
Field show all
Defined in:
lib/dill/widgets/check_box.rb

Overview

A check box.

Constant Summary

Constants included from Dill

VERSION

Instance Attribute Summary

Attributes inherited from Widget

#root

Instance Method Summary collapse

Methods inherited from Field

root

Methods inherited from Widget

action, #class?, #classes, #click, filter, filter?, find_all_in, find_in, #has_action?, #hover, #html, #id, #initialize, not_present_in?, present_in?, root, selector, #text, #value, widget_delegator

Methods included from Widgets::DSL

#form, #list, #widget

Methods included from WidgetParts::Container

#has_widget?, #not_visible?, #visible?, #widget, #widgets

Methods included from Dill

#deprecate

Methods included from Constructors

#Decimal, #Integer, #Widget

Methods included from WidgetParts::Struct

included

Constructor Details

This class inherits a constructor from Dill::Widget

Instance Method Details

#getBoolean

Returns true if the checkbox is checked, false otherwise.

Returns:

  • (Boolean)

    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.

Parameters:

  • value (Boolean)

    true to check the checkbox, false otherwise.



9
# File 'lib/dill/widgets/check_box.rb', line 9

def_delegator :root, :set

#to_cellObject



17
18
19
# File 'lib/dill/widgets/check_box.rb', line 17

def to_cell
  to_s
end

#to_sObject



22
23
24
# File 'lib/dill/widgets/check_box.rb', line 22

def to_s
  get ? 'yes' : 'no'
end