Class: Dill::FieldGroup::CheckBox

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

Overview

A check box.

Instance Attribute Summary

Attributes inherited from Widget

#root

Instance Method Summary collapse

Methods inherited from Field

find_in, present_in?

Methods inherited from Widget

#!=, #!~, #<, #<=, #==, #=~, #>, #>=, action, #click, #diff, find_in, #has_action?, #initialize, #inspect, #match, present_in?, #reload, root, selector, #text, #to_cell, #to_f, #to_i, widget, widget_delegator

Methods included from WidgetContainer

#has_widget?, #widget

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.



281
282
283
# File 'lib/dill/field_group.rb', line 281

def get
  !! root.checked?
end

#set(value) ⇒ Object

Checks or unchecks the current checkbox.

Parameters:

  • value (Boolean)

    true to check the checkbox, false otherwise.



277
# File 'lib/dill/field_group.rb', line 277

def_delegator :root, :set

#to_sObject



286
287
288
# File 'lib/dill/field_group.rb', line 286

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